mkvirtualenv python3.2 permission denied

2019-09-01 06:17发布

Trying to create a virtualenv using the command:

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

Gives me the response:

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

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

标签: python django
1条回答
小情绪 Triste *
2楼-- · 2019-09-01 06:48

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

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).

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
查看更多
登录 后发表回答