0

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. cosmic-ray 8.3.5 requires virtualenv<=16.7.10, but you have virtualenv 20.21.0 which is incompatible.

Cosmic-ray uses very old version of virtualenv and its causing conflicts with other modules which uses relatively newer versions.

In my requirements-dev.txt, I have two packages, one internally use another package virtualenv with version 20 and another one with virtualenv version 16. When I try to install the packages I get the above error.

How should we handle such scenarios?

I tried the normal ways of not mentioning the version in requirements.txt but same error happens.

Dipu Krishnan
  • 181
  • 1
  • 2
  • Then this conflict cannot be resolved without either patch the package that require the old version to use the new one, or use an older version of the other package that is compatible with the older virtualenv. – metatoaster Mar 14 '23 at 03:19

1 Answers1

0

There is no way for two versions of the same Python package to live in the same place. The dependency resolver in Python does not allow this.

In this case, there are a few things that you can do to help solve this problem:

  1. Use a virtual environment for each individual project on your machine. This will make sure that you can avoid conflicts between projects that use different versions of the same package.
  2. Try upgrading the two packages that are causing the dependency error. Newer versions of this software might be able to share the same version of the conflicting package. This can be achieved manually, or with a package manager. I use conda to manage my dependencies and their versions.
  3. If nothing else works, try to find a package with the same functionality that doesn't use the older version of virtualenv, or try to split your project into multiple pieces.