I get the same python version after installed and activated virtualenv with different python version
I get the same python version after installed and activated virtualenv with different python version
I want to use a different python version in a virtual environment. I usually create a new environment and set the python version I want. But now, in a new machine I'm working, it doesn't work. I install a venv with python3.5, activate it, but it still uses the default python3.6
virtualenv --python=python3.5 testenv
Running virtualenv with interpreter /usr/bin/python3.5
Using base prefix '/usr'
New python executable in /home/mwon/testenv/bin/python3.5
Also creating executable in /home/mwon/testenv/bin/python
Installing setuptools, pip, wheel...done.
then
source testenv/bin/activate
result:
python
Python 3.6.5 (default, Mar 29 2018, 03:28:50)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
EDIT:
Distro:
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.3 LTS"
NAME="Ubuntu"
VERSION="16.04.3 LTS (Xenial Xerus)"
Python version:
Python 3.6.5
virtualenv --python=python3.5 newtestenv; source newtestenv/bin/activate; python --version; which python
16.04.3 LTS (Xenial Xerus). How to I get the full log of virtualenv? The default python version if the 3.6.5
– Miguel
Sep 3 at 16:35
I mean, just copy-paste the terminal output as-is into a code block.
– AKX
Sep 3 at 16:37
The terminal output is the one I show in the main question. The same for the other commands. Just updated the distrib.
– Miguel
Sep 3 at 16:39
Do you have
python defined as an alias? Check the output of type python.– jwodder
Sep 3 at 16:59
python
type python
Thanks for contributing an answer to Stack Overflow!
But avoid …
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
But avoid …
To learn more, see our tips on writing great answers.
Required, but never shown
Required, but never shown
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
What system (OS, distro, etc.) is this? Can you post the full log of
virtualenv --python=python3.5 newtestenv; source newtestenv/bin/activate; python --version; which python?– AKX
Sep 3 at 16:30