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.

Setuptools install fails with PEP508 URLs

See original GitHub issue

setuptools v 45.1.0 pip v 20.0.2

Running python setup.py install for a setup.py which includes PEP508 format URLs in the install_requires field results in failure. for example if keras @ https://github.com/MarcBS/keras/archive/master.zip is in the install_requires field then setuptools fails to find it, and looks on PyPI instead, installing a matching package (in this case ‘keras’). However, running pip install . for the same setup.py succeeds, similarly with pip install keras @ https://github.com/MarcBS/keras/archive/master.zip.

If setuptools always uses pip to install dependencies, then why does it fail for PEP508 URL dependencies when pip is able to do this?

In summary:

  • pip install . works ✔️
  • pip install 'keras @ https://github.com/MarcBS/keras/archive/master.zip' works ✔️
  • python setup.py install fails ❌

(further to this, PyPI throws an error when uploading a package with a setup.py containing PEP 508 dependency links)

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:4
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
pgansslecommented, Feb 10, 2020

Our policy to date has been that if using pip install fixes your problem, you should use pip install and we won’t fix the issue.

Direct invocations of setup.py install are not the right thing to do, despite the fact that there is a lot of misleading documentation out there indicating that it is.

We to need to work out a plan for actively deprecating and then removing setup.py install to try to get the word out, though.

If someone wants to try to figure out why this is happening, feel free, but it’s not clear that we would be willing to accept a PR fixing it if it comes with any additional maintenance burden.

2reactions
drj11commented, Feb 10, 2020

hmm, that is an interesting position, given that for many of us python setup.py install is muscle memory and our fingers type it without thinking.

If pip install is the only supported route now, can that policy be documented somewhere?

Does that also apply to pip wheel versus python setup.py bdist wheel too?

Read more comments on GitHub >

github_iconTop Results From Across the Web

pip3 setup.py install_requires PEP 508 git URL for private repo
pip3 install -e . in my Python project where I have the following setup.py : from setuptools import setup setup( name ...
Read more >
History - setuptools 65.6.3.post20221216 documentation
#3502: Fixed issue with editable install and single module distributions. ... Requirement hash/equality implementation: take PEP 508 direct URL into account ...
Read more >
pipenv Documentation - Read the Docs
Fix unhashable type error during $ pipenv install --selective-upgrade #3384. • Dependencies with direct PEP508 compliant VCS URLs specified in their ...
Read more >
2020635 – pip install fails if the setuptools weak dep is not ...
Add an attachment (proposed patch, testcase, etc.) Links. System, ID, Private, Priority, Status, Summary, Last Updated. Github ...
Read more >
Packaging and distributing projects
Projects using setuptools 0.6.27+ have standard readme files ( README.rst ... see wheel Issue #92), and it is interpreted relative to the installation...
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