2014-04-02 19 views
1

virtualenv를 만들고 pip를 사용하여 프로젝트 종속성을 설치하려고합니다.NameError : pip를 사용하여 패키지를 설치할 때 'install'이름이 정의되어 있지 않습니다.

..... 

Could not find the /Users/me/.virtualenvs/myenv/lib/python2.7/site-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 

---------------------------------------- 
Cleaning up... 
Command /Users/me/.virtualenvs/myenv/bin/python -c "import setuptools;__file__='/Users/me/.virtualenvs/myenv/build/distribute/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/r0/2b441j6x5rq8y964bhd15gkm0000gn/T/pip-wyn1Ys-record/install-record.txt --single-version-externally-managed --install-headers /Users/me/.virtualenvs/myenv/include/site/python2.7 failed with error code 1 in /Users/me/.virtualenvs/myenv/build/distribute 

정확히 동일 --distribute 스위치없이 다음은 export VIRTUALENV_DISTRIBUTE=true

없이 발생합니다

$ mkvirtualenv --no-site-packages --distribute myenv 
(myenv)$ pip install -r requirements.txt 

는 또한 오류 다음과 같은 몇 가지 패키지 핍 쇼를 설치 한 후 ~/.bash_profile

export VIRTUALENV_DISTRIBUTE=true을 설정 내 requirements.txt 파일 :

Django==1.5 
Pillow==1.7.6 
South==0.7.3 
amqplib==1.0.2 
anyjson==0.3.1 
celery==2.5.3 
distribute==0.6.10 
django-celery==2.4.2 
django-indexer==0.3.0 
django-kombu==0.9.4 
django-mptt==0.5.2 
django-paging==0.2.4 
django-picklefield==0.2.1 
django-social-auth==0.7.22 
django-tagging==0.3.1 
django-taggit==0.9.3 
django-templated-email==0.4.7 
django-templatetag-sugar==0.1 
eventlet==0.9.16 
greatape==0.3.0 
greenlet==0.3.4 
html5lib==0.90 
httplib2==0.8 
kombu==2.1.7 
lockfile==0.9.1 
oauth2==1.5.211 
pycrypto==2.3 
python-daemon==1.6 
python-dateutil==1.5 
python-openid==2.2.5 
raven==1.0.4 
sentry==2.0.0-RC6 
simplejson==2.3.2 
ssh==1.7.8 
wsgiref==0.1.2 

나는 Mac OS X 10.9.2을 사용하고 있습니다. requirements.txt에서 아무 것도 변경하고 싶지 않습니다. 모든 종속성을 설치하고이 프로젝트를 실행하기 만하면됩니다.

+0

어떤 패키지에 넘어 집니까? 흥미롭게도'distribute '는 필수 패키지 중 하나입니다. – Evert

+0

'Distribute' 패키지에 실패했습니다 – user606521

+0

'.bashrc'에'VIRTUALENV_DISTRIBUTE'을 설정했지만'.bashrc'를 소스 했습니까? 그렇지 않으면 현재 쉘에서 변수가 설정되지 않습니다. – Evert

답변

3

목록에서 distribute 패키지를 제거하고 환경을 다시 만들고 요구 사항을 다시 설치하십시오.

wsgiref도 삭제할 수 있지만 중요하지는 않습니다.

+1

다음 사이트 방문객에게 도움이 될 수 있으므로 '배포판'을 설치하는 것이 오류의 원인인지 자세히 설명하십시오. –

+1

http://pythonhosted.org/distribute/ "" " Setuptools 프로젝트의 더 이상 사용되지 않는 포크 Setuptools 0.7 릴리스 이후 Setuptools 및 Distribute가 병합되고 Distribute가 더 이상 유지 관리되지 않습니다. 모든 지속적인 노력은 Setuptools 프로젝트 및 Setuptools 문서를 참조해야합니다 .. "" " –

관련 문제