How do I find the openpyxl version number - python

I was given a PC with anaconda already installed. I have got no idea which version it is other than 3.
Whenever I try to lookup techniques on openpyxl, there seem to be several, depending on the version of openpyxl. One answer will say do it one way for version 1.8, another will say do it some other way for 2.5.
How do I find out which version of openpyxl is installed so I can avoid trying techniques that either no longer work or only work for later versions.
I've looked through https://openpyxl.readthedocs.io/en/stable/api/openpyxl.html . There doesn't seem to be a function that returns the version number.

Assuming you have imported openpyxl, openpyxl.__version__ gives the version number.

You can also find the version from an installer package if you used one. I installed openpyxl using pip3, so pip3 list at the shell prompt will show the current version for all pip3 installed packages. You may need to use pip list if that is what was used on your machine.
Package Version
---------------------- ----------
astroid 2.3.3
certifi 2019.11.28
chardet 3.0.4
click 7.1.1
dnspython 1.16.0
et-xmlfile 1.0.1
idna 2.9
isort 4.3.21
jdcal 1.4.1
lazy-object-proxy 1.4.3
lml 0.0.9
mccabe 0.6.1
mysql-connector-python 8.0.19
openpyxl 3.0.3

Related

Incompatible module packages need to be solved

Well, I ran into two troubles when I want to install the modules. The first one is
1) statsmodels 0.13.2 has requirement packaging>=21.3, but you have packaging 20.9.
2) tensorflowjs 3.19.0 requires packaging~=20.9, but you have packaging 21.3 which is incompatible.
The second one is
1)sktime 0.11.0 has requirement numba>=0.53, but you have numba 0.49.0.
2)ddsp 3.2.0 requires numba<0.50, but you have numba 0.56.0 which is incompatible.
They are both conflicting, and I don't know how to do so.

No module named 'social_django' but 'social-auth-app-django' is installed

Summary of Issue
I am creating a Django project and attempting to setup Auth0 integrations. Per Auth0's documentation, I installed the social-auth-app-django library which then went and also installed social-auth-core. So please note that both these libraries are installed.
Here is my py -m pip list output proving such:
Package Version
---------------------- ---------
asgiref 3.4.1
certifi 2021.10.8
cffi 1.15.0
charset-normalizer 2.0.7
colorama 0.4.4
cryptography 35.0.0
defusedxml 0.7.1
Django 3.2.9
ecdsa 0.17.0
idna 3.3
oauthlib 3.1.1
pip 21.3.1
pyasn1 0.4.8
pycparser 2.21
PyJWT 2.3.0
python-dotenv 0.19.2
python-jose 3.3.0
python-social-auth 0.3.6
python3-openid 3.2.0
pytz 2021.3
requests 2.26.0
requests-oauthlib 1.3.0
rsa 4.7.2
setuptools 57.4.0
six 1.16.0
social-auth-app-django 5.0.0
social-auth-core 4.1.0
sqlparse 0.4.2
urllib3 1.26.7
As you can see, I'm running Django 3.2.9. I am also using Python 3.10.
After following all of Auth0's steps, I went to run py manage.py migrate and receive the following ending error message:
ModuleNotFoundError: No module named 'social_django'
What I have tried
I have tried uninstalling and reinstalling the social-auth-app-django and social-auth-core libraries multiple times. I have also tried installing the libraries individually instead of just installing social-auth-app-django. I have also tried installing social-auth-app[django] (using brackets). Nothing has worked.
Every post I can find online is telling the OP to install the social-auth-app-django library and that should fix their problem. But as demonstrated, I believe I've already done that. So unless there's a different way I need to install the library, I need a different solution.
Any and all help would be greatly appreciated. Thank you!
Huge credit to #furas in the comments helping point me in the right direction.
The Solution: Reinitialize the virtual environment using python 3.10 instead of python 3.8 and reinstall necessary packages.
Explanation: The problem was that I had inadvertently created my venv using python 3.8. So even though I'd run py -m pip list successfully while inside of the 3.8 venv, all of my packages were still installed using python 3.8. So when I'd try and migrate using python 3.10, the packages weren't viewable.

Pandas will not import because of "dateutil.tz" inside git repo, runs fine outside

I've tried uninstalling and reinstalling Anaconda. and upgrading pandas and most other questions that ask this question. I am working with a brand new installation of Anaconda. with python 3.7, Why is pandas not importing normally?
I have tried manually installing pip install pytz --upgrade and pip install python-datutil --upgrade to no avail. However, After doing these two commands I can now import pandas in the terminal but not in my script where i need it.
The Script where i am trying to import pandas is inside a git repo that perhaps needs to be reconfigured. I suspect that might be the issue. but im not sure how to change how python interacts with pandas from within git.
Here is the stacktrace...
File "C:\Users\jgreaves\Anaconda3\lib\site-packages\pandas\__init__.py", line 37, in <module>
f"C extension: {module} not built. If you want to import "
ImportError: C extension: No module named 'dateutil.tz'; 'dateutil' is not a package not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace --force' to build the C extensions first.```
Here is the config of my virtual environment
```# Name Version Build Channel
ca-certificates 2020.1.1 0 anaconda
certifi 2020.4.5.2 py38_0 anaconda
numpy 1.18.5 pypi_0 pypi
openssl 1.1.1g he774522_0 anaconda
pandas 1.0.4 pypi_0 pypi
pip 20.0.2 py38_3 anaconda
pyodbc 4.0.30 pypi_0 pypi
python 3.8.3 he1778fa_0 anaconda
python-dateutil 2.8.1 pypi_0 pypi
pytz 2020.1 pypi_0 pypi
regex 2020.6.8 pypi_0 pypi
setuptools 47.1.1 py38_0 anaconda
six 1.15.0 pypi_0 pypi
sqlite 3.31.1 he774522_0 anaconda
vc 14.1 h0510ff6_4 anaconda
vs2015_runtime 14.16.27012 hf0eaf9b_2 anaconda
wheel 0.34.2 py38_0 anaconda
wincertstore 0.2 py38_0 anaconda ```
So after having a friend of mine take a look at my directory. We discovered that I had a file in my working directory called "dateutil.py" which was supposed to be a module for my code that I very uncleverly named. This was what was causing the issue. I have since renamed the file and everything is working fine now.

Are python packages version specific?

I ma trying to install https://pypi.python.org/pypi/python-epo-ops-client
I tried installing it from pip from both latest version.
python 2.7.12 and
python 3.5.2
for both of the version it says
C:\Users\me>pip install python-epo-ops-client 2.1.0
Collecting python-epo-ops-client
Using cached python_epo_ops_client-2.1.0-py2.py3-none-any.whl
Collecting 2.1.0
Could not find a version that satisfies the requirement 2.1.0 (from versions:
)
No matching distribution found for 2.1.0
As I am completely new to python, question is:
1) Do I need to install all python version to see which version above module is compatible with?
Or
2) can I know which version of python will be compatible with above version?
I want to install python for above package only. please suggest.
You are having space between python-epo-ops-client & 2.1.0, so it is trying to install two packages.
(1) python-epo-ops-client and
(2) 2.1.0, but there isn't any package named "2.1.0"
To install specific version you need to mention ==.
pip install python-epo-ops-client==2.1.0

What does “[sdist]” mean in PIP's list of outdated packages?

Suddenly, all Python packages reported as out of date by pip with
pip list --outdated
indicate [sdist], as in
awscli (Current: 1.7.19 Latest: 1.7.20 [sdist])
botocore (Current: 0.100.0 Latest: 0.101.0 [sdist])
jmespath (Current: 0.6.1 Latest: 0.6.2 [sdist])
plotly (Current: 1.6.14 Latest: 1.6.15 [sdist])
what does [sdist] mean?
In python packaging terms, "sdist" stands for "source distribution" and it's counterpart "bdist" stands for "binary distribution".
Along with those distribution types there's also the older "egg" and the newer egg-like distribution called "wheel".
In this case it's telling you that the newer version of your packages will be installed as a source distribution. If a binary distribution would be installed, you'd see [wheel] instead.
This is a new feature, as of pip version 6.1.0.

Categories