I am trying to create a virtual environment for Python 3.4 on a fresh install of Ubuntu Server 14.04. I following the instructions for the venv module at:
https://docs.python.org/3/library/venv.html#module-venv
I don't have a lot of Python 3.4 or Ubuntu experience.
When I type the command:
pyvenv testDir
I get back:
pyvenv: command not found
What is causing this?
Ubuntu 14.04 uses Python 2 by default, and the pyenv
command does not exist in Python 2 out of the box.
You can, however, use virtualenv
for the same purpose. You just need to install it!
You should:
apt-get install -y python3 python-virtualenv
virtualenv -p $(which python3) testDir
source testDir/bin/activate
It's also possible to create virtualenv by python itself. python3 -m venv myenv
see documentation https://docs.python.org/3/library/venv.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With