How to fix transitive dependencies conflict issue?

Viewed 700

I use pipenv command to install packages in my Python virtual environment.

I need a newer version of pandas. So I installed it successfully:

pipenv install pandas~=1.0

Then I installed Apache Beam:

pipenv install apache-beam[gcp,test]

This installed Apache Beam but gave me an error:

[pipenv.exceptions.ResolutionFailure]: Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.

  First try clearing your dependency cache with $ pipenv lock --clear, then try the original command again.
 Alternatively, you can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation.
  Hint: try $ pipenv lock --pre if it is a pre-release dependency.
ERROR: ERROR: Could not find a version that matches pandas<0.25,>=0.23.4,~=1.0
...
There are incompatible versions in the resolved dependencies.

And it down-graded my pandas version to 0.24.2 which doesn't support things I need.

How can I fix this problem?

Thank you

2 Answers

Try installing it manually:

  1. upgrade pandas back to 1.0

  2. copy the pandas folder and the pandas-dist folder

  3. install the other module you needed

  4. paste the folders back in the modules folder

your modules folder should be here if you downloaded from python website

C:\Users\<user>\AppData\Local\Programs\Python\Python<version>\Lib\site-packages

or here if you downloaded from Microsoft store

C:\Users\<user>\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8\LocalCache\local-packages\Python38\site-packages

Try clearing the cache in the lock file by running:

$ pipenv lock --pre --clear

See if you can install it afterwards.

If it gives error, try:

$ pipenv lock --clear
Related