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;








2















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:



  1. Run pip install -e .

  2. 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 from setup_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?









share|improve this question



















  • 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

















2















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:



  1. Run pip install -e .

  2. 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 from setup_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?









share|improve this question



















  • 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













2












2








2








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:



  1. Run pip install -e .

  2. 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 from setup_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?









share|improve this question














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:



  1. Run pip install -e .

  2. 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 from setup_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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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 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












  • 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







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












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
);



);













draft saved

draft discarded


















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.



















draft saved

draft discarded
















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript