0

I was creating different virtual environment for each version of python using virtualenv. Executing below command throws Permission denied error.

sudo virtualenv --no-site-packages -p /usr/lib/python3 py3

Traceback (most recent call last):
  File "/usr/local/bin/virtualenv", line 9, in <module>
    load_entry_point('virtualenv==1.8.4', 'console_scripts', 'virtualenv')()
  File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 919, in main
    popen = subprocess.Popen([interpreter, file] + sys.argv[1:], env=env)
  File "/usr/lib/python2.7/subprocess.py", line 672, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1213, in _execute_child
    raise child_exception
OSError: [Errno 13] Permission denied

I have both python3 and virtualenv installed properly. Version of virtualenv is :

yolk -l virtualenv

virtualenv      - 1.8.4        - active development (/usr/local/lib/python2.7/dist-packages)

Am I missing something here? Please help me out.

BTW, without option "-p /usr/bin/python3" works fine as shown below.

sudo virtualenv --no-site-packages  pytest

New python executable in pytest/bin/python
Installing setuptools............done.
Installing pip...............done.
2
  • 1
    Maybe try install virtualenv with python3 and run that one. Commented Jan 31, 2013 at 8:35
  • @GaryvanderMerwe: Installed pip3.2 and then installed virtualenv. It worked fine. Thanks. Commented Jan 31, 2013 at 11:25

1 Answer 1

4

You need to specify /usr/bin/python3, instead of /usr/lib/python3, for the -p option.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.