Dependency conflict between 'setup_requires' and 'install_requires' in Python packageCalling an external command in PythonWhat are metaclasses in Python?What is the difference between @staticmethod and @classmethod?Finding the index of an item given a list containing it in PythonWhat is the difference between Python's list methods append and extend?How can I safely create a nested directory?Does Python have a ternary conditional operator?How to get the current time in PythonDoes Python have a string 'contains' substring method?pip install xmltodict not working
Why aren't rockets built with truss structures inside their fuel & oxidizer tanks to increase structural strength?
The oceans and the moon
Who is the controller of a Pacifism enchanting my creature?
What is the farthest a camera can see?
What unique challenges/limitations will I face if I start a career as a pilot at 45 years old?
Escape Velocity - Won't the orbital path just become larger with higher initial velocity?
Will some rockets really collapse under their own weight?
What is a "soap"?
What is the most difficult concept to grasp in Calculus 1?
Spacing in "$d=2$-dimensional"
Solving pricing problem heuristically in column generation algorithm for VRP
What if a restaurant suddenly cannot accept credit cards, and the customer has no cash?
How would armour (and combat) change if the fighter didn't need to actually wear it?
What exactly happened to the 18 crew members who were reported as "missing" in "Q Who"?
Did Michelle Obama have a staff of 23; and Melania have a staff of 4?
Bringing Power Supplies on Plane?
How do I ask for 2-3 days per week remote work in a job interview?
The more + the + comparative degree
What are the advantages of this gold finger shape?
Is there a name for the technique in songs/poems, where the rhyming pattern primes the listener for a certain line, which never comes?
What is the prop for Thor's hammer (Mjölnir) made of?
Attacking the Hydra
If a person claims to know anything could it be disproven by saying 'prove that we are not in a simulation'?
Is it really Security Misconfiguration to show a version number?
Dependency conflict between 'setup_requires' and 'install_requires' in Python package
Calling an external command in PythonWhat are metaclasses in Python?What is the difference between @staticmethod and @classmethod?Finding the index of an item given a list containing it in PythonWhat is the difference between Python's list methods append and extend?How can I safely create a nested directory?Does Python have a ternary conditional operator?How to get the current time in PythonDoes Python have a string 'contains' substring method?pip install xmltodict not working
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I came across an error when trying to install and test my package.
The error was caused by conflicting versions of transitive dependencies of two packages - one in setup_requires
(twine
) and another in install_requires
(tensorflow
).
Both transitively depend on bleach
, each with a different version.
Installing the package with pip install -e .
or python setup.py develop
works as expected.
When running python setup.py test
, an error occurs (note: this happens only when running tests after installing. If the package was not installed first, there is no error).
Traceback (most recent call last):
File "setup.py", line 3, in <module>
setup()
File "/usr/local/lib/python3.6/site-packages/setuptools/__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "/usr/local/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/local/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/local/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/root/test/.eggs/pytest_runner-4.4-py3.6.egg/ptr.py", line 189, in run
with self.project_on_sys_path():
File "/usr/local/lib/python3.6/contextlib.py", line 81, in __enter__
return next(self.gen)
File "/usr/local/lib/python3.6/site-packages/setuptools/command/test.py", line 166, in project_on_sys_path
require('%s==%s' % (ei_cmd.egg_name, ei_cmd.egg_version))
File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 900, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 791, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (bleach 3.1.0 (/root/test/.eggs/bleach-3.1.0-py3.6.egg), Requirement.parse('bleach==1.5.0'), 'tensorboard')
Steps to reproduce
I get the error with this minimal package structure:
my-package
|-- src/
| |-- module.py (empty)
|-- setup.py
|-- setup.cfg
setup.cfg looks like this:
[metadata]
name = test
version = 0.0.1
[options]
package_dir=
= src
packages=find:
setup_requires =
setuptools >= 40.0.0
pip >= 10
pytest-runner >= 2.0
twine >= 1.0.0
install_requires =
tensorflow == 1.6.0
tests_require =
pytest >=3.0, <4.0
[options.packages.find]
where=src
[aliases]
test=pytest
setup.py look like this:
from setuptools import setup
setup()
Steps:
- Run
pip install -e .
- Run
python setup.py test
Environment:
python:3.6
Docker image
What I think is happening
As far as I can tell, when running the commands (both installing and testing), packages from setup_requires
are installed and egg files are placed in .eggs directory.
When running python setup.py test
, setuptools installs all packages from install_requires
but sees that there is already an egg for one of the dependencies and uses that.
I'm not sure what the exact mechanism is.
Possible solutions
- Use newer version of tensorflow. This solved the conflict
- Or: remove
twine
fromsetup_requires
- I realised it is not required for setup - Or: Do not install the package locally. Only run
python setup.py test
Questions
Although I was able to solve the problem in this specific case, I would still like to know more about what caused it in the first place.
- At what point is the .eggs directory created?
- Why the install works fine but tests fail?
- Why tests fail only after install?
- Is there a way to prevent the conflict from happening?
python setuptools
add a comment |
I came across an error when trying to install and test my package.
The error was caused by conflicting versions of transitive dependencies of two packages - one in setup_requires
(twine
) and another in install_requires
(tensorflow
).
Both transitively depend on bleach
, each with a different version.
Installing the package with pip install -e .
or python setup.py develop
works as expected.
When running python setup.py test
, an error occurs (note: this happens only when running tests after installing. If the package was not installed first, there is no error).
Traceback (most recent call last):
File "setup.py", line 3, in <module>
setup()
File "/usr/local/lib/python3.6/site-packages/setuptools/__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "/usr/local/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/local/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/local/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/root/test/.eggs/pytest_runner-4.4-py3.6.egg/ptr.py", line 189, in run
with self.project_on_sys_path():
File "/usr/local/lib/python3.6/contextlib.py", line 81, in __enter__
return next(self.gen)
File "/usr/local/lib/python3.6/site-packages/setuptools/command/test.py", line 166, in project_on_sys_path
require('%s==%s' % (ei_cmd.egg_name, ei_cmd.egg_version))
File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 900, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 791, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (bleach 3.1.0 (/root/test/.eggs/bleach-3.1.0-py3.6.egg), Requirement.parse('bleach==1.5.0'), 'tensorboard')
Steps to reproduce
I get the error with this minimal package structure:
my-package
|-- src/
| |-- module.py (empty)
|-- setup.py
|-- setup.cfg
setup.cfg looks like this:
[metadata]
name = test
version = 0.0.1
[options]
package_dir=
= src
packages=find:
setup_requires =
setuptools >= 40.0.0
pip >= 10
pytest-runner >= 2.0
twine >= 1.0.0
install_requires =
tensorflow == 1.6.0
tests_require =
pytest >=3.0, <4.0
[options.packages.find]
where=src
[aliases]
test=pytest
setup.py look like this:
from setuptools import setup
setup()
Steps:
- Run
pip install -e .
- Run
python setup.py test
Environment:
python:3.6
Docker image
What I think is happening
As far as I can tell, when running the commands (both installing and testing), packages from setup_requires
are installed and egg files are placed in .eggs directory.
When running python setup.py test
, setuptools installs all packages from install_requires
but sees that there is already an egg for one of the dependencies and uses that.
I'm not sure what the exact mechanism is.
Possible solutions
- Use newer version of tensorflow. This solved the conflict
- Or: remove
twine
fromsetup_requires
- I realised it is not required for setup - Or: Do not install the package locally. Only run
python setup.py test
Questions
Although I was able to solve the problem in this specific case, I would still like to know more about what caused it in the first place.
- At what point is the .eggs directory created?
- Why the install works fine but tests fail?
- Why tests fail only after install?
- Is there a way to prevent the conflict from happening?
python setuptools
2
You have met a case of dependency hell.tensorflow==1.6.0
requirestensorboard==1.6.0
which requiresbleach==1.5.0
. Your setup reqs containtwine
which requiresreadme-renderer
which requiresbleach>=2.1.0
, so you basically can't install your package for development. The error comes up on tests becausepytest-runner
installs all setup dependencies to generate the egg info metadata.
– hoefling
Mar 27 at 15:04
add a comment |
I came across an error when trying to install and test my package.
The error was caused by conflicting versions of transitive dependencies of two packages - one in setup_requires
(twine
) and another in install_requires
(tensorflow
).
Both transitively depend on bleach
, each with a different version.
Installing the package with pip install -e .
or python setup.py develop
works as expected.
When running python setup.py test
, an error occurs (note: this happens only when running tests after installing. If the package was not installed first, there is no error).
Traceback (most recent call last):
File "setup.py", line 3, in <module>
setup()
File "/usr/local/lib/python3.6/site-packages/setuptools/__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "/usr/local/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/local/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/local/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/root/test/.eggs/pytest_runner-4.4-py3.6.egg/ptr.py", line 189, in run
with self.project_on_sys_path():
File "/usr/local/lib/python3.6/contextlib.py", line 81, in __enter__
return next(self.gen)
File "/usr/local/lib/python3.6/site-packages/setuptools/command/test.py", line 166, in project_on_sys_path
require('%s==%s' % (ei_cmd.egg_name, ei_cmd.egg_version))
File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 900, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 791, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (bleach 3.1.0 (/root/test/.eggs/bleach-3.1.0-py3.6.egg), Requirement.parse('bleach==1.5.0'), 'tensorboard')
Steps to reproduce
I get the error with this minimal package structure:
my-package
|-- src/
| |-- module.py (empty)
|-- setup.py
|-- setup.cfg
setup.cfg looks like this:
[metadata]
name = test
version = 0.0.1
[options]
package_dir=
= src
packages=find:
setup_requires =
setuptools >= 40.0.0
pip >= 10
pytest-runner >= 2.0
twine >= 1.0.0
install_requires =
tensorflow == 1.6.0
tests_require =
pytest >=3.0, <4.0
[options.packages.find]
where=src
[aliases]
test=pytest
setup.py look like this:
from setuptools import setup
setup()
Steps:
- Run
pip install -e .
- Run
python setup.py test
Environment:
python:3.6
Docker image
What I think is happening
As far as I can tell, when running the commands (both installing and testing), packages from setup_requires
are installed and egg files are placed in .eggs directory.
When running python setup.py test
, setuptools installs all packages from install_requires
but sees that there is already an egg for one of the dependencies and uses that.
I'm not sure what the exact mechanism is.
Possible solutions
- Use newer version of tensorflow. This solved the conflict
- Or: remove
twine
fromsetup_requires
- I realised it is not required for setup - Or: Do not install the package locally. Only run
python setup.py test
Questions
Although I was able to solve the problem in this specific case, I would still like to know more about what caused it in the first place.
- At what point is the .eggs directory created?
- Why the install works fine but tests fail?
- Why tests fail only after install?
- Is there a way to prevent the conflict from happening?
python setuptools
I came across an error when trying to install and test my package.
The error was caused by conflicting versions of transitive dependencies of two packages - one in setup_requires
(twine
) and another in install_requires
(tensorflow
).
Both transitively depend on bleach
, each with a different version.
Installing the package with pip install -e .
or python setup.py develop
works as expected.
When running python setup.py test
, an error occurs (note: this happens only when running tests after installing. If the package was not installed first, there is no error).
Traceback (most recent call last):
File "setup.py", line 3, in <module>
setup()
File "/usr/local/lib/python3.6/site-packages/setuptools/__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "/usr/local/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/local/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/local/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/root/test/.eggs/pytest_runner-4.4-py3.6.egg/ptr.py", line 189, in run
with self.project_on_sys_path():
File "/usr/local/lib/python3.6/contextlib.py", line 81, in __enter__
return next(self.gen)
File "/usr/local/lib/python3.6/site-packages/setuptools/command/test.py", line 166, in project_on_sys_path
require('%s==%s' % (ei_cmd.egg_name, ei_cmd.egg_version))
File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 900, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 791, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (bleach 3.1.0 (/root/test/.eggs/bleach-3.1.0-py3.6.egg), Requirement.parse('bleach==1.5.0'), 'tensorboard')
Steps to reproduce
I get the error with this minimal package structure:
my-package
|-- src/
| |-- module.py (empty)
|-- setup.py
|-- setup.cfg
setup.cfg looks like this:
[metadata]
name = test
version = 0.0.1
[options]
package_dir=
= src
packages=find:
setup_requires =
setuptools >= 40.0.0
pip >= 10
pytest-runner >= 2.0
twine >= 1.0.0
install_requires =
tensorflow == 1.6.0
tests_require =
pytest >=3.0, <4.0
[options.packages.find]
where=src
[aliases]
test=pytest
setup.py look like this:
from setuptools import setup
setup()
Steps:
- Run
pip install -e .
- Run
python setup.py test
Environment:
python:3.6
Docker image
What I think is happening
As far as I can tell, when running the commands (both installing and testing), packages from setup_requires
are installed and egg files are placed in .eggs directory.
When running python setup.py test
, setuptools installs all packages from install_requires
but sees that there is already an egg for one of the dependencies and uses that.
I'm not sure what the exact mechanism is.
Possible solutions
- Use newer version of tensorflow. This solved the conflict
- Or: remove
twine
fromsetup_requires
- I realised it is not required for setup - Or: Do not install the package locally. Only run
python setup.py test
Questions
Although I was able to solve the problem in this specific case, I would still like to know more about what caused it in the first place.
- At what point is the .eggs directory created?
- Why the install works fine but tests fail?
- Why tests fail only after install?
- Is there a way to prevent the conflict from happening?
python setuptools
python setuptools
asked Mar 27 at 11:24
luminarluminar
112 bronze badges
112 bronze badges
2
You have met a case of dependency hell.tensorflow==1.6.0
requirestensorboard==1.6.0
which requiresbleach==1.5.0
. Your setup reqs containtwine
which requiresreadme-renderer
which requiresbleach>=2.1.0
, so you basically can't install your package for development. The error comes up on tests becausepytest-runner
installs all setup dependencies to generate the egg info metadata.
– hoefling
Mar 27 at 15:04
add a comment |
2
You have met a case of dependency hell.tensorflow==1.6.0
requirestensorboard==1.6.0
which requiresbleach==1.5.0
. Your setup reqs containtwine
which requiresreadme-renderer
which requiresbleach>=2.1.0
, so you basically can't install your package for development. The error comes up on tests becausepytest-runner
installs all setup dependencies to generate the egg info metadata.
– hoefling
Mar 27 at 15:04
2
2
You have met a case of dependency hell.
tensorflow==1.6.0
requires tensorboard==1.6.0
which requires bleach==1.5.0
. Your setup reqs contain twine
which requires readme-renderer
which requires bleach>=2.1.0
, so you basically can't install your package for development. The error comes up on tests because pytest-runner
installs all setup dependencies to generate the egg info metadata.– hoefling
Mar 27 at 15:04
You have met a case of dependency hell.
tensorflow==1.6.0
requires tensorboard==1.6.0
which requires bleach==1.5.0
. Your setup reqs contain twine
which requires readme-renderer
which requires bleach>=2.1.0
, so you basically can't install your package for development. The error comes up on tests because pytest-runner
installs all setup dependencies to generate the egg info metadata.– hoefling
Mar 27 at 15:04
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55376039%2fdependency-conflict-between-setup-requires-and-install-requires-in-python-pa%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.
Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55376039%2fdependency-conflict-between-setup-requires-and-install-requires-in-python-pa%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
You have met a case of dependency hell.
tensorflow==1.6.0
requirestensorboard==1.6.0
which requiresbleach==1.5.0
. Your setup reqs containtwine
which requiresreadme-renderer
which requiresbleach>=2.1.0
, so you basically can't install your package for development. The error comes up on tests becausepytest-runner
installs all setup dependencies to generate the egg info metadata.– hoefling
Mar 27 at 15:04