Pyvenv puts both Python 2 and Python 3 in the same environment. Shocked!

Paul Rudin paul.nospam at rudin.co.uk
Wed Dec 21 02:21:54 EST 2016


Malik Rumi <malik.a.rumi at gmail.com> writes:

> I just created a new venv using pyvenv from a 2.7 install. Now I am shocked to
> see that I can get both 2.7 and 3.4 in this same venv:
>
> (memory) malikarumi at Tetuoan2:~/Projects/cannon/New2.7Projects/memory$ python
> Python 2.7.12 (default, Nov 19 2016, 06:48:10) 
> [GCC 5.4.0 20160609] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>>>> exit()
> (memory) malikarumi at Tetuoan2:~/Projects/cannon/New2.7Projects/memory$ python3
> Python 3.4.2 (default, Apr 17 2015, 18:47:05) 
> [GCC 4.8.2] on linux
> Type "help", "copyright", "credits" or "license" for more information.

A venv doesn't remove everything from your path. Presumably python3 is
some system installed python. What does "which python3" say?

If you just invoke "python" then you'll get the venv one.




More information about the Python-list mailing list