Runtime ContextualVersionConflict error with setuptools after installing project dependencies
See original GitHub issue-
I am on the latest Poetry version.
-
I have searched the issues of this repo and believe that this is not a duplicate.
-
[n/a] If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option). -
OS version and name:
Linux 5.1.15-arch1-1-ARCH #1 SMP PREEMPT Tue Jun 25 04:49:39 UTC 2019 x86_64 GNU/Linux
-
Poetry version: 0.12.17
-
Link of a Gist with the contents of your pyproject.toml file: https://pastebin.com/raw/LLmpq71Y
Issue
The poetry install
command completes without errors, but a ContextualVersionConflict
error is raised when trying to run a command within the project. It looks like poetry is installing setuptools version 40.8.0, but tensorboard requires at least 41.0.0.
Traceback (most recent call last):
File "/project/.venv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 583, in _build_master
ws.require(__requires__)
File "/project/.venv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 900, in require
needed = self.resolve(parse_requirements(requirements))
File "/project/.venv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 791, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (setuptools 40.8.0 (/project/.venv/lib/python3.7/site-packages), Requirement.parse('setuptools>=41.0.0'), {'tensorboard'})
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/project/.venv/bin/science", line 6, in <module>
from pkg_resources import load_entry_point
File "/project/.venv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3191, in <module>
@_call_aside
File "/project/.venv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3175, in _call_aside
f(*args, **kwargs)
File "/project/.venv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3204, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/project/.venv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 585, in _build_master
return cls._build_from_requirements(__requires__)
File "/project/.venv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 598, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/project/.venv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 791, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (setuptools 40.8.0 (/project/.venv/lib/python3.7/site-packages), Requirement.parse('setuptools>=41.0.0'), {'tensorboard'})
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
python 3.7.6 pip setup.py test with ContextualVersionConflict
The real problem is I did not remove the old .eggs/ and venv/ folder when I made the packages version change. So the...
Read more >pypa/setuptools - Gitter
The project tells me to python setup.py build which fails fast and gives no errors ... Will python setup.py install install the dependencies...
Read more >Mailman 3 - Distutils-SIG - python.org
Shutting down the distutils-sig mailing list has been suggested since December 2020, notably by Pradyun Gedam who also raised the issue again in...
Read more >pkg_resources — bob.db.cohface 1.1.6 documentation
Should be initialized with the installed Distribution and the requested ... Can't extract file(s) to egg cache The following error occurred while trying...
Read more >Read error message carefully Python - Dance with Programming
Yesterday, I tried to install a python package in a conda environment. ... trials to beat this error; upgrading pip or upgrading setuptools....
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 FreeTop 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
Top GitHub Comments
While executing
pip install
, changing the version of setuptools possibly breaks dependencies, so I thinkpoetry run pip install -U setuptools && poetry install
is a correct currently and unfortunately. In that sense, I agree this:This issue seems to be due to venv’s setuptools. I tried a workaround (
poetry run pip install -U setuptools
beforepoetry install
) and fixed the issue,but I think that the desirable fix is that poetry avoids taking the version of venv’s setuptools into consideration.