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.

pip install fails with missing `setuptools.command` error

See original GitHub issue

I get the following stack trace trying to pip install or upgrate drfdocs, using Python 2.7, on both a mac running OS X 10.11.5 and a Ubuntu 14.04 machine.

[ubuntu@SEA] pip install --upgrade drfdocs
Downloading/unpacking drfdocs from https://pypi.python.org/packages/e5/9e/3a9aa6908ad7bd95b46f7fe05256681f4101de9a7769b6928159a986ef61/drfdocs-0.0.11.tar.gz#md5=ae42aba1e598ac110de74bdad0f3d3f4
  Downloading drfdocs-0.0.11.tar.gz (771kB): 771kB downloaded
  Running setup.py (path:<VIRTUAL_ENV_PATH>/build/drfdocs/setup.py) egg_info for package drfdocs
    Traceback (most recent call last):
      File "<string>", line 3, in <module>
    ImportError: No module named setuptools.command
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 3, in <module>

ImportError: No module named setuptools.command

----------------------------------------
Cleaning up...

Both installs were done within virtualenvs with django1.9 installed. pip versions were 1.5.4 & 1.5.6

I didn’t find this behavior with any other pip modules. Don’t know if it’s something DrfDocs is doing in its setup or some other setup-related issue.

Cheers!

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:5
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
veryhappythingscommented, Jan 18, 2019

The reason this is happening for some people and not others, as far as I can tell, is that a fair number of people have $PYTHONPATH=. set somewhere in their environments. I had this, and it didn’t work - when I removed it, it worked. If you don’t have it, the site directory doesn’t get used instead of the built in library. I think there’s something on my system that sets this for me, because it was being set even when I removed it from my zshrc - perhaps a part of virtualenvwrapper?

As a quick fix, this should work:

unset PYTHONPATH
pip install drfdocs
5reactions
evandronecommented, Jul 21, 2016

As a sidenote, got the same result with pip install drfdocs==0.0.10, but successfully installed 0.0.09 with pip install drfdocs==0.0.09

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pip install error. Setuptools.command not found - Stack Overflow
Try installing: sudo apt-get install python-setuptools. if this doesn't work try: curl -O https://bootstrap.pypa.io/get-pip.py python ...
Read more >
ERROR: Can not execute `setup.py` since setuptools is not ...
Problem description Hi, I am new to python and I am trying to install the email package, but it says "setuptools is not...
Read more >
[Fixed] ModuleNotFoundError: No module named 'setuptools'
The most frequent source of this error is that you haven't installed setuptools explicitly with pip install setuptools . Alternatively, you may have ......
Read more >
2020635 – pip install fails if the setuptools weak dep is not ...
Description of problem: pip install fails if setuptools is not installed on the system. It is a weak dependency, but those are meant...
Read more >
ModuleNotFoundError: No module named 'setuptools' in Python
The Python "ModuleNotFoundError: No module named 'setuptools'" occurs when setuptools is not installed in our Python environment. To solve the error, ...
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