Ubuntu 14.04 - Python 3.4 - pyenv: command Not Found

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:

  • Install Python 3 and virtualenv apt-get install -y python3 python-virtualenv
  • Create a Python 3 virtualenv: virtualenv -p $(which python3) testDir
  • Activate the virtual environment with 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

Tags:

Python

Ubuntu