fredley/play-pi

setuptools must be installed to install from a source distribution

Closed this issue ยท 5 comments

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)

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

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.

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)

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

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)