virtualenv:无法创建'/lib/python2.7':权限被拒绝

时间:2013-09-24 10:59:36

标签: python virtualenv

这里可能有什么问题?

user@linux> virtualenv foobar
....
error: could not create '/lib/python2.7': Permission denied
----------------------------------------
...Installing Setuptools...done.
Traceback (most recent call last):
  File "/usr/bin/virtualenv", line 9, in <module>
    load_entry_point('virtualenv==1.10.1', 'console_scripts', 'virtualenv')()
  File "/usr/lib/python2.7/site-packages/virtualenv.py", line 821, in main
    symlink=options.symlink)
  File "/usr/lib/python2.7/site-packages/virtualenv.py", line 961, in create_environment
    install_sdist('Setuptools', 'setuptools-*.tar.gz', py_executable, search_dirs)
  File "/usr/lib/python2.7/site-packages/virtualenv.py", line 932, in install_sdist
    filter_stdout=filter_install_output)
  File "/usr/lib/python2.7/site-packages/virtualenv.py", line 899, in call_subprocess
    % (cmd_desc, proc.returncode))
OSError: Command /home/modwork_guf_dfj/foobar/bin/python setup.py install --single-version-externally-managed --record record failed with error code 1

virtualenv --version 1.10.1

1 个答案:

答案 0 :(得分:8)

回答我自己的问题。 在〜/ .pydistutils.cfg中设置了一个空前缀。在评论此前缀后,创建virtualenv工作。

#http://stackoverflow.com/questions/4495120/combine-user-with-prefix-error-with-setup-py-install

#[install]
#prefix=