2013-04-03 92 views
1

我試圖建立一個虛擬的環境中,我也得到了以下錯誤:錯誤設置的virtualenv文件夾

$virtualenv ./olp/ 
New python executable in ./olp/bin/python 
Installing setuptools............done. 
Installing pip..... 
    Complete output from command /home/tom/Documents/Dev/olp/bin/python -x /home/tom/Documents/Dev/olp/bin/easy_install ./pip-X.X.tar.gz: 
    Processing pip-X.X.tar.gz 
error: Not a recognized archive type: ./pip-X.X.tar.gz 
---------------------------------------- 
...Installing pip...done. 
Traceback (most recent call last): 
    File "/usr/local/bin/virtualenv", line 9, in <module> 
    load_entry_point('virtualenv==1.9.1', 'console_scripts', 'virtualenv')() 
    File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 979, in main 
    no_pip=options.no_pip) 
    File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 1094, in create_environment 
    install_pip(py_executable, search_dirs=search_dirs, never_download=never_download) 
    File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 667, in install_pip 
    filter_stdout=_filter_setup) 
    File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 1057, in call_subprocess 
    % (cmd_desc, proc.returncode)) 
OSError: Command /home/tom/Documents/Dev/olp/bin/python -x /home/tom/Documents/Dev/olp/bin/easy_install ./pip-X.X.tar.gz failed with error code 1 

然後好像創建虛擬環境:

olp$ tree 
. 
├── bin 
│   ├── easy_install 
│   ├── easy_install-2.7 
│   ├── python 
│   ├── python2 -> python 
│   └── python2.7 -> python 
├── include 
│   └── python2.7 -> /usr/include/python2.7 
├── lib 
│   └── python2.7 
│    ├── _abcoll.py -> /usr/lib/python2.7/_abcoll.py 
│    ├── _abcoll.pyc 
│    ├── abc.py -> /usr/lib/python2.7/abc.py 
│    ├── abc.pyc 
│    ├── codecs.py -> /usr/lib/python2.7/codecs.py 
│    ├── codecs.pyc 
│    ├── config -> /usr/lib/python2.7/config 
│    ├── copy_reg.py -> /usr/lib/python2.7/copy_reg.py 
│    ├── copy_reg.pyc 
│    ├── distutils 
│    │   ├── distutils.cfg 
│    │   ├── __init__.py 
│    │   └── __init__.pyc 
│    ├── encodings -> /usr/lib/python2.7/encodings 
│    ├── fnmatch.py -> /usr/lib/python2.7/fnmatch.py 
│    ├── fnmatch.pyc 
│    ├── genericpath.py -> /usr/lib/python2.7/genericpath.py 
│    ├── genericpath.pyc 
│    ├── lib-dynload -> /usr/lib/python2.7/lib-dynload 
│    ├── linecache.py -> /usr/lib/python2.7/linecache.py 
│    ├── linecache.pyc 
│    ├── locale.py -> /usr/lib/python2.7/locale.py 
│    ├── no-global-site-packages.txt 
│    ├── ntpath.py -> /usr/lib/python2.7/ntpath.py 
│    ├── orig-prefix.txt 
│    ├── os.py -> /usr/lib/python2.7/os.py 
│    ├── os.pyc 
│    ├── posixpath.py -> /usr/lib/python2.7/posixpath.py 
│    ├── posixpath.pyc 
│    ├── re.py -> /usr/lib/python2.7/re.py 
│    ├── re.pyc 
│    ├── site-packages 
│    │   ├── easy-install.pth 
│    │   ├── setuptools-0.6c11-py2.7.egg 
│    │   └── setuptools.pth 
│    ├── site.py 
│    ├── site.pyc 
│    ├── sre_compile.py -> /usr/lib/python2.7/sre_compile.py 
│    ├── sre_compile.pyc 
│    ├── sre_constants.py -> /usr/lib/python2.7/sre_constants.py 
│    ├── sre_constants.pyc 
│    ├── sre_parse.py -> /usr/lib/python2.7/sre_parse.py 
│    ├── sre_parse.pyc 
│    ├── sre.py -> /usr/lib/python2.7/sre.py 
│    ├── stat.py -> /usr/lib/python2.7/stat.py 
│    ├── stat.pyc 
│    ├── types.py -> /usr/lib/python2.7/types.py 
│    ├── types.pyc 
│    ├── UserDict.py -> /usr/lib/python2.7/UserDict.py 
│    ├── UserDict.pyc 
│    ├── warnings.py -> /usr/lib/python2.7/warnings.py 
│    ├── warnings.pyc 
│    ├── _weakrefset.py -> /usr/lib/python2.7/_weakrefset.py 
│    └── _weakrefset.pyc 
└── local 
    ├── bin -> /home/tom/Documents/Dev/olp/bin 
    ├── include -> /home/tom/Documents/Dev/olp/include 
    └── lib -> /home/tom/Documents/Dev/olp/lib 

燦任何人幫助我的錯誤?我做錯了什麼?

回答

1

我發現問題所在。當我啓動virtualenv並且它試圖在另一個安裝的頂部安裝pip並且變得困惑時,似乎我不在該文件夾內。