0

I am using a server that runs CentOS. The default version of python there is 2.7. It also has python3.4 installed.

The package I need to work with requires python3.5. I installed python3.5 but it was a local install (path: /usr/local/lib/python3/5). How do I set up a virtualenv for python3.5?

I am trying the usual

virtualenv --python=/usr/local/lib/python3.5 .env

that I use for making python2.7 and python3.4 virtualenvs but I am getting this error:

The path /usr/local/lib/python3.5 (from --python=/usr/local/lib/python3.5) is not an executable file

The same command works for python2.7 and 3.4. Is it something to do with the local install?

1 Answer 1

1

Try this:

/usr/local/lib/python3.5 -m virtualenv env

What we are doing here is making sure we are running the specific python3.5 executable you have installed in a local folder and wanted to use and telling it to invoke it's virtualenv module (hence the -m for module).

Tip: In fact you can use the -m to run all sorts of things like: python3.5 -m pip --version and so forth.

Using this technique you can setup virtual environments without touching and of the other python versions that may be on your system or in the system path.

You must log in to answer this question.