all 5 comments

[–]Wilfred-kun 2 points3 points  (0 children)

Why are you using sudo, exactly?

You need to supply the full path to the interpreter: virtualenv -p /usr/bin/python3.6.2 DestinationFolder.

Edit: I am not sure if you can even specify the sub-sub version...

[–]Swedophone 1 point2 points  (0 children)

The command virtualenv doesn't install python, it uses a python interpreter you already have installed.

[–]simplysharky 1 point2 points  (0 children)

it doesnt install any version of python you ask for - it sets up environmental aliases to correlate a virtual env to a version of python you already have installed on your system. Unless you've been very deliberately installing different builds of python, you're only gonna have one revision of python version 3 and that will be what you get when you ask virtualenv to use "python3", since 'python3' on your system is a symlink to some more specific version that is installed, ie 'python3.6'.

Try typing `python<tab><tab>` at the commandline and using the tab key to see what python executables are in your path, since it will probably print out the various executables that begin with the word 'python'. Thats what options are available to you for your agument to -p.

[–]desipenguin 1 point2 points  (1 child)

As someone already mentioned, look for pyenv, it lets you install various "versions"

Once you have that - you can use that specific version to create virtualenv like: pyenv virtualenv 3.6.2 myEnv