mkvirtualenv python3.2权限被拒绝 [英] mkvirtualenv python3.2 permission denied

查看:176
本文介绍了mkvirtualenv python3.2权限被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Trying to create a virtualenv using the command:

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?

How oh how can I start a virtualenv using python3.2?

推荐答案

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

You need to supply the path to the path to the Python interpreter with -p, not the lib directory.

因为你传递该目录,virtualenv正在尝试执行它,因此您得到权限被拒绝。所以在 bin 目录中使用 python 可执行文件的路径(使用哪个python3。 2 ,以确定你是否不知道该位置。)

Because you're passing that directory, virtualenv is trying to execute it, and therefore you get Permission denied. So use the path to the python executable in the bin directory instead (use which python3.2 to find out if you don't know the location).

这应该可以工作,假设你的Python 3.2解释器可以在 /usr/local/bin/python3.2

This should work, assuming your Python 3.2 interpreter can be found at /usr/local/bin/python3.2:

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

这篇关于mkvirtualenv python3.2权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆