Der Versuch, ein Python Pip-Paket (Django Erholung Rahmen docs, drfdocs
) zu installieren, auf dem Mac OS X in einem virtualenv:Import: Kein Modul mit dem Namen setuptools.command auf Mac OS X innerhalb virtualenv
Hier sind die entsprechenden Versionen von pip , python, easy_install:
$ virtualenv --version
1.11.4
$ mkvirtualenv test
New python executable in test/bin/python
Installing setuptools, pip...done.
(test)$ python --version; which python
Python 2.7.10
/Users/me/.virtualenvs/test/bin/python
(test)$ pip --version; which pip
pip 1.5.4 from /Users/me/.virtualenvs/test/lib/python2.7/site-packages (python 2.7)
/Users/me/.virtualenvs/test/bin/pip
(test)$ easy_install --version; which easy_install
setuptools 2.2
/Users/me/.virtualenvs/test/bin/easy_install
(test)$ python -c "import setuptools.command; print setuptools.command"
<module 'setuptools.command' from '/Users/me/.virtualenvs/test/lib/python2.7/site-packages/setuptools/command/__init__.pyc'>
Und hier ist der Fehler:
$ pip install drfdocs
Downloading/unpacking drfdocs
Downloading drfdocs-0.0.11.tar.gz (771kB): 771kB downloaded
Running setup.py (path:/Users/me/.virtualenvs/test/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...
Command python setup.py egg_info failed with error code 1 in /Users/me/.virtualenvs/test/build/drfdocs
Storing debug log for failure in /Users/me/.pip/pip.log
ich eine Vielzahl von Korrekturen von anderen Stack-Überlauf versucht Antworten here, aber keine funktionierte.
$ pip install -U setuptools
half auch nicht.
EDIT: Wie gewünscht:
(test)$ python -c "import setuptools; print setuptools.__file__; print setuptools.__version__"
/Users/me/.virtualenvs/test/lib/python2.7/site-packages/setuptools/__init__.pyc
2.2
EDIT # 2: Ich habe versucht, pip install pip --upgrade
so dass ich jetzt auf pip==8.1.2
bin.
Nun, wenn ich zu installieren versuchen, erhalte ich eine etwas andere Fehler:
(test)$ python
Python 2.7.10 (default, Oct 23 2015, 19:19:21)
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import setuptools
>>> exit()
(test)$ pip --version
pip 8.1.2 from /Users/me/.virtualenvs/test/lib/python2.7/site-packages (python 2.7)
(test)$ pip install drfdocs
Collecting drfdocs
Using cached drfdocs-0.0.11.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named setuptools
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/kc/00fkv5q91vz815b2jycc8cv40000gn/T/pip-build-olnkAD/drfdocs/
Noch keinen Sinn macht, warum dies allerdings geschieht.
Wenn Sie 'pip freeze', können Sie sehen, SetupTools im Ergebnis? –
Was ist die Ausgabe dieses Snippets von einer interaktiven Python-Shell? 'importieren Sie setuptools; setuptools .__ Datei__; setuptools .__ version__' –
@Justin: nein, tut es nicht. Ich sehe nur "wsgiref == 0.1.2" für meinen "test" virtualenv. – lollercoaster