Skip to content
This repository has been archived by the owner on Mar 20, 2021. It is now read-only.

setuptools must be installed to install from a source distribution #22

Closed
buzzbo opened this issue Sep 29, 2015 · 5 comments
Closed

setuptools must be installed to install from a source distribution #22

buzzbo opened this issue Sep 29, 2015 · 5 comments

Comments

@buzzbo
Copy link

buzzbo commented Sep 29, 2015

I can follow instructions etc, but sometimes I am noobish I'm running into problems after running sudo pip install -r requirements.txt

  Running setup.py install for distribute
    Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-fwiyGt/distribute/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-BzmPBG-record/install-record.txt --single-version-externally-managed --compile:
    Before install bootstrap.
    Scanning installed packages
    Setuptools installation detected at /usr/local/lib/python2.7/dist-packages
    Non-egg installation
    Removing elements out of the way...
    Renaming /usr/local/lib/python2.7/dist-packages/setuptools-14.3-py2.7.egg-info into /usr/local/lib/python2.7/dist-packages/setuptools-14.3-py2.7.egg-info.OLD.1443501722.78
    Renaming /usr/local/lib/python2.7/dist-packages/setuptools into /usr/local/lib/python2.7/dist-packages/setuptools.OLD.1443501722.78
    Could not find the /usr/local/lib/python2.7/dist-packages/pkg_resources.py element of the Setuptools distribution
    Could not find the /usr/local/lib/python2.7/dist-packages/site.py element of the Setuptools distribution
    Patched done.
    Relaunching...
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    NameError: name 'install' is not defined

    ----------------------------------------
  Rolling back uninstall of distribute
Command "/usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-fwiyGt/distribute/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-BzmPBG-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-fwiyGt/distribute

After some searching, it seems that distribute and setuptools are really different versions of the same thing, although I have a very basic understanding of how pip works. So I try sudo pip install setuptools --no-use-wheel --upgrade

/usr/local/lib/python2.7/dist-packages/pip-7.1.2-py2.7.egg/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
Requirement already up-to-date: setuptools in /usr/local/lib/python2.7/dist-packages

I think I have also tried sudo easy_install Distribute and sudo easy_install --upgrade pip (I'm button-mashing at this point). So I try sudo pip install -r requirements.txt again and get

Requirement already satisfied (use --upgrade to upgrade): Django==1.5 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): appdirs==1.4.0 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): argparse==1.2.1 in /usr/lib/python2.7 (from -r requirements.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade): decorator==3.4.0 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 4))
Collecting distribute==0.6.24 (from -r requirements.txt (line 5))
  Using cached distribute-0.6.24.tar.gz
setuptools must be installed to install from a source distribution

I guess I have python 2.7.3 and pip 7.1.2 from /usr/local/lib/python2.7/dist-packages/pip-7.1.2-py2.7.egg (python 2.7)

@fredley
Copy link
Owner

fredley commented Sep 29, 2015

Hmm, this is very strange. Has anybody else had this issue?

@buzzbo
Copy link
Author

buzzbo commented Sep 30, 2015

I did some more searching and took a long trip around the block with different things, ultimately finding my answer here. It's an issue with pip and setuptools/distribute. I followed the instructions and reran the install and it worked.

@buzzbo buzzbo closed this as completed Sep 30, 2015
@revenz
Copy link

revenz commented Feb 28, 2016

had the same issue, fixed it by running

sudo pip install -U setuptools

just in case someone else stumbles on this issue from google (like me)

@fredley
Copy link
Owner

fredley commented Feb 29, 2016

@revenz Thanks for that, I've added it as a step to the readme

@HassankSalim
Copy link

my pip install commands are installing package for python 3.5
is this a issue

pip --version

pip 9.0.1 from /usr/local/lib/python3.5/dist-packages (python 3.5)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants