5

I'm trying to understand how to create an isolated python environment using an alternative version of Python other than the default (in my case this is Python 2.7). virtualenv works on my system with Python 2.7, but I can't seem to create a virtual environment with a version of Python 3.

I tried to specify the Python version as outlined in this this post, like this:

$ virtualenv -p /usr/bin/python3.2

Can anyone explain how I can create a virtualenv with a specific version of Python? Thanks very much.

2
  • What errors did you see? Commented Nov 5, 2011 at 20:45
  • 1
    The error I got was: The executable /usr/bin/python3.2 (from --python=/usr/bin/python3.2) does not exist Commented Nov 5, 2011 at 20:46

1 Answer 1

9

I believe you need to install python 3.2 to the system first. You're telling the virtualenvironment to use a version of python that doesn't exist anywhere so it cannot find it. This is the "does not exist"

Edit after more info was given in comment:

virtualenv -p /usr/local/bin/python3.2
Sign up to request clarification or add additional context in comments.

4 Comments

Thanks for the help. Perhaps I don't understand. I have Python 3.2 installed at: /usr/local/bin/python3.2 Why can't it find it?
@dr.bunsen: In your question, you used /usr/bin/ instead of /usr/local/bin/. Typo or simple solution?
Try using that path in your virtualenv -p command instead of /usr/bin/python3.2
Ahh, thanks! I didn't see that in fact usr/local/bin and usr/bin were in fact different paths. Thanks.

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.