question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Exit code is 0 for `ERROR: <module-a version-1> has requirement <module-b version-1>, but you'll have <module-b version-2> which is incompatible.`

See original GitHub issue
  • Operating system: Linux nemkin-testing 4.9.0-11-amd64 #1 SMP Debian 4.9.189-3 (2019-09-02) x86_64 GNU/Linux

Python2 example:

  • Pip version: pip 19.3.1
  • Python version: Python 2.7.13

Python3 example:

  • Pip version: pip 9.0.1
  • Python version: Python 3.5.3

Original issue

I am building Docker images where one of the steps is to install some pypi packages. I found that the Docker image build is successful, however looking at the output logs I see the following printed quite often:

ERROR: <module-a version-1> has requirement <module-b version-1>, but you'll have <module-b version-2> which is incompatible.

Reproducing with Python2

Using Python2 I am able to reproduce the issue with a small example. I found out that pip2 reports an exit code of 0, even when the above error is present, which causes Docker to report success on the build.

See the following example:

  • Pip version: pip 19.3.1
  • Python version: Python 2.7.13
nemkin@nemkin-testing:~$ virtualenv test
Running virtualenv with interpreter /usr/bin/python2
New python executable in /home/nemkin/test/bin/python2
Also creating executable in /home/nemkin/test/bin/python
Installing setuptools, pkg_resources, pip, wheel...done.
nemkin@nemkin-testing:~$ source test/bin/activate
(test) nemkin@nemkin-testing:~$ python --version
Python 2.7.13
(test) nemkin@nemkin-testing:~$ pip --version
pip 19.3.1 from /home/nemkin/test/local/lib/python2.7/site-packages/pip (python 2.7)
(test) nemkin@nemkin-testing:~$ pip install google-cloud-storage==1.13.2 google-cloud-core==0.28.1
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-proce
ss/#python-2-support
Collecting google-cloud-storage==1.13.2
  Using cached https://files.pythonhosted.org/packages/92/da/115f23ba9aa56f4d5de3f02306a36eb6d0884561e0059987865cb0cce42e/google_cloud_storage-1.13.2-py2.py3-none-any.whl
Collecting google-cloud-core==0.28.1
  Using cached https://files.pythonhosted.org/packages/0f/41/ae2418b4003a14cf21c1c46d61d1b044bf02cf0f8f91598af572b9216515/google_cloud_core-0.28.1-py2.py3-none-any.whl
Collecting google-api-core<2.0.0dev,>=1.6.0
  Using cached https://files.pythonhosted.org/packages/29/3a/c528ef37f48d6ffba16f0f3c0426456ba21e0dd32be9c61a2ade93e07faa/google_api_core-1.14.3-py2.py3-none-any.whl
Collecting google-resumable-media>=0.3.1
  Using cached https://files.pythonhosted.org/packages/35/9e/f73325d0466ce5bdc36333f1aeb2892ead7b76e79bdb5c8b0493961fa098/google_resumable_media-0.5.0-py2.py3-none-any.whl
Collecting requests<3.0.0dev,>=2.18.0
  Using cached https://files.pythonhosted.org/packages/51/bd/23c926cd341ea6b7dd0b2a00aba99ae0f828be89d72b2190f27c11d4b7fb/requests-2.22.0-py2.py3-none-any.whl
Collecting pytz
  Using cached https://files.pythonhosted.org/packages/e7/f9/f0b53f88060247251bf481fa6ea62cd0d25bf1b11a87888e53ce5b7c8ad2/pytz-2019.3-py2.py3-none-any.whl
Collecting futures>=3.2.0; python_version < "3.2"
  Downloading https://files.pythonhosted.org/packages/d8/a6/f46ae3f1da0cd4361c344888f59ec2f5785e69c872e175a748ef6071cdb5/futures-3.3.0-py2-none-any.whl
Collecting six>=1.10.0
  Using cached https://files.pythonhosted.org/packages/65/26/32b8464df2a97e6dd1b656ed26b2c194606c16fe163c695a992b36c11cdf/six-1.13.0-py2.py3-none-any.whl
Requirement already satisfied: setuptools>=34.0.0 in ./test/lib/python2.7/site-packages (from google-api-core<2.0.0dev,>=1.6.0->google-cloud-storage==1.13.2) (42.0.2)
Collecting google-auth<2.0dev,>=0.4.0
  Using cached https://files.pythonhosted.org/packages/ec/11/1d90cbfa72a084b08498e8cea1fee199bc965cdac391d241f5ae6257073e/google_auth-1.7.2-py2.py3-none-any.whl
Collecting protobuf>=3.4.0
  Downloading https://files.pythonhosted.org/packages/a3/27/9a375cc85b90c93ab847370c31fe1302a763b6cd57d54daee20171d720ff/protobuf-3.11.1-cp27-cp27mu-manylinux1_x86_64.whl (1.3MB)
     |████████████████████████████████| 1.3MB 5.2MB/s 
Collecting googleapis-common-protos<2.0dev,>=1.6.0
  Using cached https://files.pythonhosted.org/packages/eb/ee/e59e74ecac678a14d6abefb9054f0bbcb318a6452a30df3776f133886d7d/googleapis-common-protos-1.6.0.tar.gz
Collecting idna<2.9,>=2.5
  Using cached https://files.pythonhosted.org/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl
Collecting chardet<3.1.0,>=3.0.2
  Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
Collecting certifi>=2017.4.17
  Using cached https://files.pythonhosted.org/packages/b9/63/df50cac98ea0d5b006c55a399c3bf1db9da7b5a24de7890bc9cfd5dd9e99/certifi-2019.11.28-py2.py3-none-any.whl
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1
  Using cached https://files.pythonhosted.org/packages/b4/40/a9837291310ee1ccc242ceb6ebfd9eb21539649f193a7c8c86ba15b98539/urllib3-1.25.7-py2.py3-none-any.whl
Collecting pyasn1-modules>=0.2.1
  Using cached https://files.pythonhosted.org/packages/52/50/bb4cefca37da63a0c52218ba2cb1b1c36110d84dcbae8aa48cd67c5e95c2/pyasn1_modules-0.2.7-py2.py3-none-any.whl
Collecting rsa<4.1,>=3.1.4
  Using cached https://files.pythonhosted.org/packages/02/e5/38518af393f7c214357079ce67a317307936896e961e35450b70fad2a9cf/rsa-4.0-py2.py3-none-any.whl
Collecting cachetools<3.2,>=2.0.0
  Using cached https://files.pythonhosted.org/packages/2f/a6/30b0a0bef12283e83e58c1d6e7b5aabc7acfc4110df81a4471655d33e704/cachetools-3.1.1-py2.py3-none-any.whl
Collecting pyasn1<0.5.0,>=0.4.6
  Using cached https://files.pythonhosted.org/packages/62/1e/a94a8d635fa3ce4cfc7f506003548d0a2447ae76fd5ca53932970fe3053f/pyasn1-0.4.8-py2.py3-none-any.whl
Building wheels for collected packages: googleapis-common-protos
  Building wheel for googleapis-common-protos (setup.py) ... done
  Created wheel for googleapis-common-protos: filename=googleapis_common_protos-1.6.0-cp27-none-any.whl size=77578 sha256=9b0c64f2faf534e3c05fc5e03a42e782f28002e747f6583c72181b698df0216b
  Stored in directory: /home/nemkin/.cache/pip/wheels/9e/3d/a2/1bec8bb7db80ab3216dbc33092bb7ccd0debfb8ba42b5668d5
Successfully built googleapis-common-protos
ERROR: google-cloud-storage 1.13.2 has requirement google-cloud-core<0.30dev,>=0.29.0, but you'll have google-cloud-core 0.28.1 which is incompatible.
Installing collected packages: idna, chardet, certifi, urllib3, requests, pytz, futures, six, pyasn1, pyasn1-modules, rsa, cachetools, google-auth, protobuf, googleapis-common-protos, google-api-core, google-cloud-core, google-resumable-media, google-cloud-storage
Successfully installed cachetools-3.1.1 certifi-2019.11.28 chardet-3.0.4 futures-3.3.0 google-api-core-1.14.3 google-auth-1.7.2 google-cloud-core-0.28.1 google-cloud-storage-1.13.2 google-resumable-media-0.5.0 googleapis-common-protos-1.6.0 idna-2.8 protobuf-3.11.1 pyasn1-0.4.8 pyasn1-modules-0.2.7 pytz-2019.3 requests-2.22.0 
rsa-4.0 six-1.13.0 urllib3-1.25.7
(test) nemkin@nemkin-testing:~$ echo $?
0

Python3 is different

I was not able to trigger a similar error in Python3.

See the following example:

  • Pip version: pip 9.0.1
  • Python version: Python 3.5.3
nemkin@nemkin-testing:~$ python3 -m venv test
nemkin@nemkin-testing:~$ source test/bin/activate
(test) nemkin@nemkin-testing:~$ python --version
Python 3.5.3
(test) nemkin@nemkin-testing:~$ pip --version
pip 9.0.1 from /home/nemkin/test/lib/python3.5/site-packages (python 3.5)
(test) nemkin@nemkin-testing:~$ pip install wheel
Collecting wheel
  Using cached https://files.pythonhosted.org/packages/00/83/b4a77d044e78ad1a45610eb88f745be2fd2c6d658f9798a15e384b7d57c9/wheel-0.33.6-py2.py3-none-any.whl
Installing collected packages: wheel
Successfully installed wheel-0.33.6
(test) nemkin@nemkin-testing:~$ pip install google-cloud-storage==1.13.2 google-cloud-core==0.28.1
Collecting google-cloud-storage==1.13.2
  Using cached https://files.pythonhosted.org/packages/92/da/115f23ba9aa56f4d5de3f02306a36eb6d0884561e0059987865cb0cce42e/google_cloud_storage-1.13.2-py2.py3-none-any.whl
Collecting google-cloud-core==0.28.1
  Using cached https://files.pythonhosted.org/packages/0f/41/ae2418b4003a14cf21c1c46d61d1b044bf02cf0f8f91598af572b9216515/google_cloud_core-0.28.1-py2.py3-none-any.whl
Collecting google-resumable-media>=0.3.1 (from google-cloud-storage==1.13.2)
  Using cached https://files.pythonhosted.org/packages/35/9e/f73325d0466ce5bdc36333f1aeb2892ead7b76e79bdb5c8b0493961fa098/google_resumable_media-0.5.0-py2.py3-none-any.whl
Collecting google-api-core<2.0.0dev,>=1.6.0 (from google-cloud-storage==1.13.2)
  Using cached https://files.pythonhosted.org/packages/29/3a/c528ef37f48d6ffba16f0f3c0426456ba21e0dd32be9c61a2ade93e07faa/google_api_core-1.14.3-py2.py3-none-any.whl
Collecting six (from google-resumable-media>=0.3.1->google-cloud-storage==1.13.2)
  Using cached https://files.pythonhosted.org/packages/65/26/32b8464df2a97e6dd1b656ed26b2c194606c16fe163c695a992b36c11cdf/six-1.13.0-py2.py3-none-any.whl
Collecting protobuf>=3.4.0 (from google-api-core<2.0.0dev,>=1.6.0->google-cloud-storage==1.13.2)
  Using cached https://files.pythonhosted.org/packages/13/89/00dbb9f5f73be0d8101719d79fdd4b916aad441177a17f899aa7366854dd/protobuf-3.11.1-cp35-cp35m-manylinux1_x86_64.whl
Collecting googleapis-common-protos<2.0dev,>=1.6.0 (from google-api-core<2.0.0dev,>=1.6.0->google-cloud-storage==1.13.2)
  Using cached https://files.pythonhosted.org/packages/eb/ee/e59e74ecac678a14d6abefb9054f0bbcb318a6452a30df3776f133886d7d/googleapis-common-protos-1.6.0.tar.gz
Collecting pytz (from google-api-core<2.0.0dev,>=1.6.0->google-cloud-storage==1.13.2)
  Using cached https://files.pythonhosted.org/packages/e7/f9/f0b53f88060247251bf481fa6ea62cd0d25bf1b11a87888e53ce5b7c8ad2/pytz-2019.3-py2.py3-none-any.whl
Collecting requests<3.0.0dev,>=2.18.0 (from google-api-core<2.0.0dev,>=1.6.0->google-cloud-storage==1.13.2)
  Using cached https://files.pythonhosted.org/packages/51/bd/23c926cd341ea6b7dd0b2a00aba99ae0f828be89d72b2190f27c11d4b7fb/requests-2.22.0-py2.py3-none-any.whl
Collecting google-auth<2.0dev,>=0.4.0 (from google-api-core<2.0.0dev,>=1.6.0->google-cloud-storage==1.13.2)
  Using cached https://files.pythonhosted.org/packages/ec/11/1d90cbfa72a084b08498e8cea1fee199bc965cdac391d241f5ae6257073e/google_auth-1.7.2-py2.py3-none-any.whl
Collecting setuptools>=34.0.0 (from google-api-core<2.0.0dev,>=1.6.0->google-cloud-storage==1.13.2)
  Using cached https://files.pythonhosted.org/packages/54/28/c45d8b54c1339f9644b87663945e54a8503cfef59cf0f65b3ff5dd17cf64/setuptools-42.0.2-py2.py3-none-any.whl
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 (from requests<3.0.0dev,>=2.18.0->google-api-core<2.0.0dev,>=1.6.0->google-cloud-storage==1.13.2)
  Using cached https://files.pythonhosted.org/packages/b4/40/a9837291310ee1ccc242ceb6ebfd9eb21539649f193a7c8c86ba15b98539/urllib3-1.25.7-py2.py3-none-any.whl
Collecting idna<2.9,>=2.5 (from requests<3.0.0dev,>=2.18.0->google-api-core<2.0.0dev,>=1.6.0->google-cloud-storage==1.13.2)
  Using cached https://files.pythonhosted.org/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl
Collecting certifi>=2017.4.17 (from requests<3.0.0dev,>=2.18.0->google-api-core<2.0.0dev,>=1.6.0->google-cloud-storage==1.13.2)
  Using cached https://files.pythonhosted.org/packages/b9/63/df50cac98ea0d5b006c55a399c3bf1db9da7b5a24de7890bc9cfd5dd9e99/certifi-2019.11.28-py2.py3-none-any.whl
Collecting chardet<3.1.0,>=3.0.2 (from requests<3.0.0dev,>=2.18.0->google-api-core<2.0.0dev,>=1.6.0->google-cloud-storage==1.13.2)
  Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
Collecting rsa<4.1,>=3.1.4 (from google-auth<2.0dev,>=0.4.0->google-api-core<2.0.0dev,>=1.6.0->google-cloud-storage==1.13.2)
  Using cached https://files.pythonhosted.org/packages/02/e5/38518af393f7c214357079ce67a317307936896e961e35450b70fad2a9cf/rsa-4.0-py2.py3-none-any.whl
Collecting pyasn1-modules>=0.2.1 (from google-auth<2.0dev,>=0.4.0->google-api-core<2.0.0dev,>=1.6.0->google-cloud-storage==1.13.2)
  Using cached https://files.pythonhosted.org/packages/52/50/bb4cefca37da63a0c52218ba2cb1b1c36110d84dcbae8aa48cd67c5e95c2/pyasn1_modules-0.2.7-py2.py3-none-any.whl
Collecting cachetools<3.2,>=2.0.0 (from google-auth<2.0dev,>=0.4.0->google-api-core<2.0.0dev,>=1.6.0->google-cloud-storage==1.13.2)
  Using cached https://files.pythonhosted.org/packages/2f/a6/30b0a0bef12283e83e58c1d6e7b5aabc7acfc4110df81a4471655d33e704/cachetools-3.1.1-py2.py3-none-any.whl
Collecting pyasn1>=0.1.3 (from rsa<4.1,>=3.1.4->google-auth<2.0dev,>=0.4.0->google-api-core<2.0.0dev,>=1.6.0->google-cloud-storage==1.13.2)
  Using cached https://files.pythonhosted.org/packages/62/1e/a94a8d635fa3ce4cfc7f506003548d0a2447ae76fd5ca53932970fe3053f/pyasn1-0.4.8-py2.py3-none-any.whl
Building wheels for collected packages: googleapis-common-protos
  Running setup.py bdist_wheel for googleapis-common-protos ... done
  Stored in directory: /home/nemkin/.cache/pip/wheels/9e/3d/a2/1bec8bb7db80ab3216dbc33092bb7ccd0debfb8ba42b5668d5
Successfully built googleapis-common-protos
Installing collected packages: six, google-resumable-media, setuptools, protobuf, googleapis-common-protos, pytz, urllib3, idna, certifi, chardet, requests, pyasn1, rsa, pyasn1-modules, cachetools, google-auth, google-api-core, google-cloud-core, google-cloud-storage
  Found existing installation: setuptools 33.1.1
    Uninstalling setuptools-33.1.1:
      Successfully uninstalled setuptools-33.1.1
Successfully installed cachetools-3.1.1 certifi-2019.11.28 chardet-3.0.4 google-api-core-1.14.3 google-auth-1.7.2 google-cloud-core-0.28.1 google-cloud-storage-1.13.2 google-resumable-media-0.5.0 googleapis-common-protos-1.6.0 idna-2.8 protobuf-3.11.1 pyasn1-0.4.8 pyasn1-modules-0.2.7 pytz-2019.3 requests-2.22.0 rsa-4.0 setuptools-42.0.2 six-1.13.0 urll
ib3-1.25.7

Questions

  1. Why is pip2 reporting an exit code of 0 with this error present in the logs: ERROR: <module-a version-1> has requirement <module-b version-1>, but you'll have <module-b version-2>?
  2. Since python2 is almost already deprecated, I don’t care about issues with pip2. Can you show me an example where a similar error message is triggered using python3?
  3. If such an example exists, and the exit code is 0 there too, why is that the case?
  4. If such an example doesn’t exist was this type of error removed from pip somewhere along the line?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
uranusjrcommented, Dec 9, 2019

Just want to explain this part:

Python3 is different I was not able to trigger a similar error in Python3.

The different is not Python 2 vs 3, but that you have different versions of pip in those two environments. The one in your Python 2 is newer. The same error should be visible if you upgrade pip in your Python 3 environment.

0reactions
nemkincommented, Dec 10, 2019

Tested the same install command in the Python3 example with pip 19.3.1 and it triggered the error, thanks @uranusjr for pointing it out! 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Go Modules Reference - The Go Programming Language
After a suitable module has been found, the go command will add a new requirement with the new module's path and version to...
Read more >
Why does pip claim that I have an incompatible module ...
You have a module named ics which has dependency on the arrow module ... and run pip install -r requirements.txt to install all...
Read more >
Troubleshoot Python errors in Azure Functions - Microsoft Learn
This article supports both the v1 and v2 programming models. ... This section helps you troubleshoot module-related errors in your Python ...
Read more >
Modules - Go Programming Language Wiki
mod will end up with require M v1.2.3 , which indicates module M is a dependency with allowed version >= v1.2.3 (and <...
Read more >
Anatomy of Modules in Go - Medium
You will get this error if you initiate a go module inside $GOPATH ... 1.2.0 has the major version 1 , minor version...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found