mkvirtualenv python3.2权限被拒绝

时间:2015-03-08 12:04:12

标签: python django

尝试使用以下命令创建virtualenv:

mkvirtualenv -p /usr/local/lib/python3.2 splinter

给我回复:

Running virtualenv with interpreter /usr/local/lib/python3.2
Traceback (most recent call last):
  File "/usr/local/bin/virtualenv", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.2/dist-packages/virtualenv.py", line 784, in main
    popen = subprocess.Popen([interpreter, file] + sys.argv[1:], env=env)
  File "/usr/lib/python3.2/subprocess.py", line 745, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.2/subprocess.py", line 1361, in _execute_child
    raise child_exception_type(errno_num, err_msg)
OSError: [Errno 13] Permission denied

如何使用python3.2开始使用virtualenv?

1 个答案:

答案 0 :(得分:2)

您需要提供带有-p的Python 解释器路径的路径,而不是lib目录。

因为您正在传递该目录,所以virtualenv正在尝试执行它,因此您获得了Permission denied。因此,请使用python目录中bin可执行文件的路径(使用which python3.2查看您是否知道该位置)。

这应该有效,假设您的Python 3.2解释器可以在/usr/local/bin/python3.2找到:

mkvirtualenv -p /usr/local/bin/python3.2 splinter