2012-04-14 1 views
0

에서 다운로드 한 패키지를 설치할 수 없습니다 나는 내 VIRTUALENV에 setup.py 설치 파이썬으로 설치하고 싶었내가 저장소 <a href="https://github.com/jklaiho/django-class-fixtures" rel="nofollow">Django class fixtures</a>을 다운로드 한 VIRTUALENV

(test)/tmp/django-class-fixtures $ cdvirtualenv 
(test)/home/kuba/.virtualenvs/test $ cd lib/python2.7/site-packages 
(test)/home/kuba/.virtualenvs/test/lib/python2.7/site-packages $ ls 
django        PIL 
Django-1.4-py2.7.egg-info   PIL.pth 
django_class_fixtures-0.8-py2.7.egg pip-1.1-py2.7.egg 
easy-install.pth      setuptools-0.6c11-py2.7.egg 
IPython        setuptools.pth 
ipython-0.12-py2.7.egg-info 
(test)/home/kuba/.virtualenvs/test/lib/python2.7/site-packages $ 

의견이 있으십니까?

편집 : 내가 예를 들어 쉘에서 class_fixtures을 가져올 :

(test)/home/kuba/.virtualenvs/test/lib/python2.7/site-packages $ ipython 
Python 2.7.2+ (default, Oct 4 2011, 20:06:09) 
Type "copyright", "credits" or "license" for more information. 

IPython 0.11 -- An enhanced Interactive Python. 
?   -> Introduction and overview of IPython's features. 
%quickref -> Quick reference. 
help  -> Python's own help system. 
object? -> Details about 'object', use 'object??' for extra details. 

In [1]: import class_fixtures 
--------------------------------------------------------------------------- 
ImportError        Traceback (most recent call last) 
/home/kuba/.virtualenvs/test/lib/python2.7/site-packages/<ipython-input-1-6a049da89661> in <module>() 
----> 1 import class_fixtures 

ImportError: No module named class_fixtures 

In [2]: 
+0

당신이 더 많은 것을 기대 :

IPython이 사이트 패키지를 인식 ~/.ipython/profile_default/startup/00-virtualenv.py 또는 비슷한 이름의 파일이 뭔가를 넣어 얻으려면? – mensi

+0

쉘에서 class_fixtures를 가져올 수 있으리라 생각합니다. 질문이 업데이트되었습니다. – mrbox

+0

모듈의 이름이'django_class_fixtures'입니다. – mensi

답변

3

문제는이 설명 된대로 IPython, 당신의 VIRTUALENV에서 패키지를 무시 아니에요 패키지가 설치되지 않는 것이있다 here. 나는 당신이 단지 python과 대화 형 셸을 발사하면 모든 것을 잘 가져올 수 있다는 것을 알게 될 것입니다.

from __future__ import print_function 
import site 
from os import environ 
from os.path import join 
from sys import version_info 

if 'VIRTUAL_ENV' in environ: 
    virtual_env = join(
     environ.get('VIRTUAL_ENV'), 
     'lib', 
     'python%d.%d' % version_info[:2], 
     'site-packages' 
    ) 
    site.addsitedir(virtual_env) 
    print('VIRTUAL_ENV ->', virtual_env) 
    del virtual_env 
    del site, environ, join, version_info 
관련 문제