Why does this happens when downgrading the library - python

Why does this happens when downgrading the library
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
pyppeteer 0.2.5 requires importlib-metadata<3.0.0,>=2.1.1; python_version < "3.8", but you have importlib-metadata 4.12.0 which is incompatible.
pyppeteer 0.2.5 requires urllib3<2.0.0,>=1.25.8, but you have urllib3 1.24.3 which is incompatible.
Successfully installed appdirs-1.4.4 attrs-22.1.0 black-22.1.0 click-8.1.3 importlib-metadata-4.12.0 pathspec-0.10.1 regex-2022.8.17 toml-0.10.2 typed-ast-1.5.4 typing-extensions-4.3.0 zipp-3.8.1
WARNING: You are using pip version 22.0.4; however, version 22.2.2 is available.
You should consider upgrading via the '/Users/admin/.local/share/virtualenvs/scrapers-XJakbnzz/bin/python -m pip install --upgrade pip' command.

This is a conflict of package versions. To fix it, you'll need to follow these steps:
1)pip list
2)copy all of your packages
3)create a new file called requirements.txt
4)put all of your packages in there (without versions). The file should look like this:
autopep8
certifi
chardet
charset-normalizer
click
colorama
discord
Flask
itsdangerous
pip
praw
(except this has to be a list of your packages that you got while running pip list)
5)pip install -r requirements.txt
This will tell pip to solve the version conflict.

Related

ContextualVersionConflict, when attempting to pip install google-cloud-bigquery on AWS SageMaker

pip install google-cloud-bigquery
Requirement already satisfied: pyasn1<0.5.0,>=0.4.6 in /home/ec2-user/anaconda3/envs/python3/lib/python3.8/site-packages (from pyasn1-modules>=0.2.1->google-auth<3.0dev,>=1.25.0->google-api-core[grpc]!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0,<3.0.0dev,>=1.31.5->google-cloud-bigquery) (0.4.8)
Installing collected packages: pyasn1-modules, protobuf, grpcio, google-crc32c, cachetools, proto-plus, googleapis-common-protos, google-resumable-media, google-auth, grpcio-status, google-api-core, google-cloud-core, google-cloud-bigquery-storage, google-cloud-bigquery
Attempting uninstall: protobuf
Found existing installation: protobuf 3.19.1
Uninstalling protobuf-3.19.1:
Successfully uninstalled protobuf-3.19.1
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
sagemaker 2.117.0 requires protobuf<4.0,>=3.1, but you have protobuf 4.21.9 which is incompatible.
Successfully installed cachetools-5.2.0 google-api-core-2.10.2 google-auth-2.14.1 google-cloud-bigquery-3.4.0 google-cloud-bigquery-storage-2.16.2 google-cloud-core-2.3.2 google-crc32c-1.5.0 google-resumable-media-2.4.0 googleapis-common-protos-1.57.0 grpcio-1.51.0 grpcio-status-1.51.0 proto-plus-1.22.1 protobuf-4.21.9 pyasn1-modules-0.2.8
WARNING: You are using pip version 22.0.4; however, version 22.3.1 is available.
You should consider upgrading via the '/home/ec2-user/anaconda3/envs/python3/bin/python -m pip install --upgrade pip' command.
Note: you may need to restart the kernel to use updated packages.
ContextualVersionConflict: (protobuf 3.19.1 (/home/ec2-user/anaconda3/envs/python3/lib/python3.8/site-packages), Requirement.parse('protobuf!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<5.0.0dev,>=3.19.5'), {'google-cloud-bigquery-storage'})
Try running pip install -U protobuf~=3.20.0 and then pip install google-cloud-bigquery.
Protobuf 4.x versions have some incompatibilities with other libraries.
Ref: How to downgrade protobuf

Conflict of protobuf versions between tensorflow 2.3.1 and cirq

Currently started to learn TFQ and been trying to do this tutorial of tensorflow authors, but if I run the first line (!pip install -q tensorflow==2.3.1 --user) I get this error:
ERROR: pip's dependency resolver does not currently take into account
all the packages that are installed. This behaviour is the source of
the following dependency conflicts. cirq 0.8.0 requires
protobuf==3.8.0, but you have protobuf 3.15.7 which is incompatible.
And when I run the second line (!pip install -q tensorflow-quantum --user) I get this one:
ERROR: pip's dependency resolver does not currently take into account
all the packages that are installed. This behaviour is the source of
the following dependency conflicts. tensorflow 2.3.1 requires
protobuf>=3.9.2, but you have protobuf 3.8.0 which is incompatible.
Cirq 0.8.0 wants protobuf 3.8.0; tensorflow 2.3.1 wants protobuf>=3.9.2 and there is nothing in between and when I do "pip freeze", I only see protobuf==3.8.0, so my pip freeze doesn't see the protobuf 3.15.7 version that the error mentions of (when I do "pip show protobuf" i get the same result of version 3.8.0).
What should I do to prevent this conflict?
Note:
Python version = 3.7.9 (couldn't install tf and/or tfq with either 3.8 nor 3.9);
OS = Windows 10
Installing two different packages on same environment overrides most of the other. This is the way pip works.It is recommended to use virtual environment for each package.
python -m tf_nightly --system-site-packages .\venv
.\venv\Scripts\activate
pip install --upgrade pip
pip install tf-nightly

imageio.ffmpeg.download() Requires a different install of imageio, and imageio won't install a different version

I'd like to run VideoFileClip from moviepy. I'm running Spyder through Anaconda.
When I do try to run it, I get the error:
RuntimeError: imageio.ffmpeg.download() has been deprecated. Use 'pip install imageio-ffmpeg' instead.'
When I try pip install imageio-ffmpeg, I get:
Requirement already satisfied: imageio-ffmpeg in c:\programdata\anaconda3\lib\site-packages (0.3.0)
Other answers recommend sudo pip install imageio==2.4.1. I get the error:
moviepy 1.0.0 has requirement imageio<3.0,>=2.5; python_version >= "3.4", but you'll have imageio 2.4.1 which is incompatible.
Installing collected packages: imageio
Found existing installation: imageio 2.5.0
Cannot uninstall 'imageio'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
If I try conda remove imageio I eventually get...
The following packages will be REMOVED:
imageio-2.5.0-py37_0
moviepy-0.2.3.5-py_0
scikit-image-0.14.2-py37ha925a31_0
So I'm concerned that if I actually remove imageio and install v2.4.1, I'll auto-remove moviepy, and then when I eventually reinstall moviepy, it will bump my imageio up to 2.5 again, completing the circle of incompatibility.
Any help?
Try using this
pip install moviepy --ignore-installed
That's caused by the update of imageio
Use this instead:
sudo pip3 install imageio==2.4.1

Django failed to build wheel for python-ldap

I'm new to Python Django, I have integrated my Django application on Windows 7 machine. When I tried to integrate LDAP by using pip install django-auth-ldap but unfortunately I got an error
Failed building wheel for python-ldap
Running setup.py clean for python-ldap
Failed to build python-ldap
django-python3-ldap 0.11.1 has requirement pyasn1==0.3.2, but you'll have pyasn1 0.4.4 which is incompatible.
Please help me to escape me from this issue, bcz I have been struck here for a couple of days
I think this message is pretty clear:
django-python3-ldap 0.11.1 has requirement pyasn1==0.3.2, but you'll have pyasn1 0.4.4 which is incompatible.
When using django-python3-ldap you have to explicitly use version 0.3.2 of module pyasn1. But something else already installed a newer version of pyasn1 to you build environment.
So you have to specify version pinning information in install_requires or requirements files.
Try Updating pip using
python -m pip install -U pip
or
pip install --upgrade pip

Best practice for `pip install` red warnings?

I have it many times that when installing with pip I get success messages followed by red lines with warnings. An example:
Successfully built qgrid
spacy 2.0.11 has requirement regex==2017.4.5, but you'll have regex 2017.11.9 which is incompatible.
proto-google-cloud-vision-v1 0.90.3 has requirement oauth2client<4.0dev,>=2.0.0, but you'll have oauth2client 4.1.2 which is incompatible.
proto-google-cloud-speech-v1beta1 0.15.3 has requirement oauth2client<4.0dev,>=2.0.0, but you'll have oauth2client 4.1.2 which is incompatible.
proto-google-cloud-spanner-v1 0.15.3 has requirement oauth2client<4.0dev,>=2.0.0, but you'll have oauth2client 4.1.2 which is incompatible.
How do I reconcile the state of the install in such cases? do these messages simply imply that older versions will be used so that the compatibility of previously installed packages will preserve? does it also imply that the newly installed package has requested newer versions and may or may not work well, with the old ones present?
How do you usually proceed in these cases?
Obviously working with virtual environments may remove the clashes, but I can see this happening also in virtual environments.
Thanks!
In these case, try :
py -m name_of_your_initial_package install --upgrade name_of_your_initial_package.
name_of_your_initial_package* example: proto-google-cloud-vision-v1
Full example :
py -m proto-google-cloud-vision-v1 install --upgrade proto-google-cloud-vision-v1
To do that you need to install your package with pip before :
py -m pip install proto-google-cloud-vision-v1

Categories