我之前遇到了一個問題,試圖在我的virtualenv中安裝gevent。我嘗試了幾個不同的東西,包括一些導出命令,安裝XCode命令行工具,安裝GCC編譯器...都沒有工作。Virtualenv正試圖在系統目錄中安裝
在這個過程中,我設法搞砸了我的virtualenv安裝。我已經刪除了virtualenv目錄,並試圖重新創建它,但沒有運氣。我卸載並重新安裝了virtualenv(使用pip),並且在運行以下命令後仍然出現以下錯誤。
命令:
virtualenv ENV
我想知道爲什麼它尋找/資源庫在安裝目錄。有什麼地方可以解決這個問題嗎?
UPDATE V2:刪除虛擬捲餅
輸出繼電器與--verbose:
Creating ENV/lib/python2.7
Symlinking Python bootstrap modules
Symlinking ENV/lib/python2.7/config
Symlinking ENV/lib/python2.7/lib-dynload
Symlinking ENV/lib/python2.7/os.py
Ignoring built-in bootstrap module: posix
Symlinking ENV/lib/python2.7/posixpath.py
Cannot import bootstrap module: nt
Symlinking ENV/lib/python2.7/ntpath.py
Symlinking ENV/lib/python2.7/genericpath.py
Symlinking ENV/lib/python2.7/fnmatch.py
Symlinking ENV/lib/python2.7/locale.py
Symlinking ENV/lib/python2.7/encodings
Symlinking ENV/lib/python2.7/codecs.py
Symlinking ENV/lib/python2.7/stat.py
Symlinking ENV/lib/python2.7/UserDict.py
Symlinking ENV/lib/python2.7/copy_reg.py
Symlinking ENV/lib/python2.7/types.py
Symlinking ENV/lib/python2.7/re.py
Symlinking ENV/lib/python2.7/sre.py
Symlinking ENV/lib/python2.7/sre_parse.py
Symlinking ENV/lib/python2.7/sre_constants.py
Symlinking ENV/lib/python2.7/sre_compile.py
Symlinking ENV/lib/python2.7/warnings.py
Symlinking ENV/lib/python2.7/linecache.py
Symlinking ENV/lib/python2.7/_abcoll.py
Symlinking ENV/lib/python2.7/abc.py
Symlinking ENV/lib/python2.7/_weakrefset.py
Creating ENV/lib/python2.7/site-packages
Writing ENV/lib/python2.7/site.py
Writing ENV/lib/python2.7/orig-prefix.txt
Writing ENV/lib/python2.7/no-global-site-packages.txt
Creating parent directories for ENV/include
Symlinking ENV/include/python2.7
Creating ENV/bin
New python executable in ENV/bin/python
Changed mode of ENV/bin/python to 0755
Symlinking ENV/.Python
Testing executable with ENV/bin/python -c "import sys;out=sys.stdout;getattr(out, "buffer", out).write(sys.prefix.encode("utf-8"))"
Got sys.prefix result: u'/Users/aharwood/Documents/SUCode/mds-item-read-svc/ENV'
Creating ENV/lib/python2.7/distutils
Writing ENV/lib/python2.7/distutils/__init__.py
Writing ENV/lib/python2.7/distutils/distutils.cfg
Using existing setuptools egg: /Library/Python/2.7/site-packages/virtualenv-1.9.1-py2.7.egg/virtualenv_support/setuptools-0.6c11-py2.7.egg
Installing setuptools...
error: can't create or remove files in install directory
The following error occurred while trying to add or remove files in the
installation directory:
[Errno 13] Permission denied: '/Library/Python/2.7/site-packages/test-easy-install-3535.write-test'
The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/Library/Python/2.7/site-packages/
Perhaps your account does not have write access to this directory? If the
installation directory is a system-owned directory, you may need to sign in
as the administrator or "root" account. If you do not have administrative
access to this machine, you may wish to choose a different installation
directory, preferably one that is listed in your PYTHONPATH environment
variable.
For information on other options, you may wish to consult the
documentation at:
http://peak.telecommunity.com/EasyInstall.html
Please make the appropriate changes for your system and try again.
Complete output from command /Users/aharwood/Docu...d-svc/ENV/bin/python -c "#!python
\"\"\"Bootstra...sys.argv[1:])
" /Library/Python/2.7/...ols-0.6c11-py2.7.egg:
error: can't create or remove files in install directory
The following error occurred while trying to add or remove files in the
installation directory:
[Errno 13] Permission denied: '/Library/Python/2.7/site-packages/test-easy-install-3535.write-test'
The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/Library/Python/2.7/site-packages/
Perhaps your account does not have write access to this directory? If the
installation directory is a system-owned directory, you may need to sign in
as the administrator or "root" account. If you do not have administrative
access to this machine, you may wish to choose a different installation
directory, preferably one that is listed in your PYTHONPATH environment
variable.
For information on other options, you may wish to consult the
documentation at:
http://peak.telecommunity.com/EasyInstall.html
Please make the appropriate changes for your system and try again.
----------------------------------------
...Installing setuptools...done.
Traceback (most recent call last):
File "/usr/local/bin/virtualenv", line 8, in <module>
load_entry_point('virtualenv==1.9.1', 'console_scripts', 'virtualenv')()
File "/Library/Python/2.7/site-packages/virtualenv-1.9.1-py2.7.egg/virtualenv.py", line 979, in main
no_pip=options.no_pip)
File "/Library/Python/2.7/site-packages/virtualenv-1.9.1-py2.7.egg/virtualenv.py", line 1091, in create_environment
search_dirs=search_dirs, never_download=never_download)
File "/Library/Python/2.7/site-packages/virtualenv-1.9.1-py2.7.egg/virtualenv.py", line 611, in install_setuptools
search_dirs=search_dirs, never_download=never_download)
File "/Library/Python/2.7/site-packages/virtualenv-1.9.1-py2.7.egg/virtualenv.py", line 583, in _install_req
cwd=cwd)
File "/Library/Python/2.7/site-packages/virtualenv-1.9.1-py2.7.egg/virtualenv.py", line 1057, in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command /Users/aharwood/Docu...d-svc/ENV/bin/python -c "#!python
\"\"\"Bootstra...sys.argv[1:])
" /Library/Python/2.7/...ols-0.6c11-py2.7.egg failed with error code 1
UPDATE V3:我發現的東西我也嘗試安裝GEVENT之一。這會導致我的問題嗎?
sudo port install libevent
CFLAGS="-I /opt/local/include -L /opt/local/lib" pip install gevent
我認爲你的'virtualenv'仍然是hosed:而不是嘗試在env中安裝setuptools,它是系統範圍內安裝(由於權限不足而失敗)。嘗試運行'virtualenv --verbose ENV'來查看日誌中是否有可能提供線索的東西。 – robertklep