ContextualVersionConflict on requirement to re-install when no egg_info and --process-dependency-links
See original GitHub issue- Pip version: 9.0.1
- Python version: 2.7.12
- Operating system: Ubuntu 16.04
Description:
In a particular case, unexpected ContextualVersionConflict
occurs.
$ pip install --process-dependency-links -e .
Obtaining file:///.../pip-issue-4537
Exception:
Traceback (most recent call last):
...
ContextualVersionConflict: (simplejson 3.9.0 (.../env/lib/python2.7/site-packages), Requirement.parse('simplejson==3.10.0'), set(['pip-issue-4537']))
The conditions are:
- pip==9.0.1 (no problem in 8.1.2)
- The package to be installed has a dependency. The dependent package was already installed but different version. So it should be upgraded.
- Use
--process-dependency-links
option. - Use
-e
option. - No
egg_info
directory yet.
What I’ve run:
Here’s the steps to reproduce this issue:
$ pip install pip==9.0.1
$ mkdir pip-issue-4537
$ cd pip-issue-4537
$ echo "from setuptools import setup" > setup.py
$ echo "setup(name='pip-issue-4537', install_requires=['simplejson==3.10.0'])" >> setup.py
$ pip install simplejson==3.9.0
$ pip install --process-dependency-links -e .
Obtaining file:///.../pip-issue-4537
Exception:
Traceback (most recent call last):
...
ContextualVersionConflict: (simplejson 3.9.0 (.../env/lib/python2.7/site-packages), Requirement.parse('simplejson==3.10.0'), set(['pip-issue-4537']))
But if we have a egg_info
directory, this error doesn’t occur:
$ python setup.py install_egg_info
$ pip install --process-dependency-links -e .
Obtaining file:///.../pip-issue-4537
Exception:
Traceback (most recent call last):
...
ContextualVersionConflict: (simplejson 3.9.0 (.../env/lib/python2.7/site-packages), Requirement.parse('simplejson==3.10.0'), set(['pip-issue-4537']))
Issue Analytics
- State:
- Created 6 years ago
- Reactions:8
- Comments:13 (4 by maintainers)
Top Results From Across the Web
python 3.7.6 pip setup.py test with ContextualVersionConflict
I have tried to add the urllib3 version in install_requires , tests_require and in requirements.txt , but no luck so far. setuptools ·...
Read more >pkg_resources.ContextualVersionConflict: importlib-metadata ...
I have no problems on building and uploading the package from local, this issue happens only with the Travis pipeline. This is the...
Read more >Read error message carefully Python - Dance with Programming
Yesterday, I tried to install a python package in a conda environment. ... /tmp/pip-pip-egg-info-gipoehix cwd: /tmp/pip-req-build-vtqxcvpj/ ...
Read more >mlagents-learn ContextualVersionConflict error related to ...
I'm not knowledgeable enough in Python packages configuration to know how ... raise VersionConflict(dist, req).with_context(dependent_req)
Read more >[Solved] pip pip ImportError: cannot import name 'main' after update
pip ContextualVersionConflict on requirement to re-install when no egg_info and --process-dependency-links. Hi We encounter this at Circleci As a workaround ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi,
We encounter this at Circleci. As a workaround you can make egg-info before:
Hi,
In case someone else encounters this situation:
I faced this issue on Gitlab CI when reusing the same virtualenv between builds. When the previous build had run
pip install -e .
, the corresponding*.egg-info/
is cleaned up at the start of the next build, which will result inContextualVersionConflict
exception when runningpip install -e .
.By removing the
*.egg-link
file in the reused virtualenv, I can rerunpip install -e .
without problems.Thanks !
Edit: The most reliable way :
pip remove
the packages installed as-e
on CI clean-up (after_script
with Gitlab CI).