Instantly share code, notes, and snippets.

What would you like to do?
Python Virtual Environments on Debian and Ubuntu

pyvenv-3.3 (Ubuntu 13.10, also Debian)


pyvenv-3.3 venvdir
venvdir/bin/python -c 'import sys; print(sys.path)'
# This should print the venvdir in sys.path.
# But in buggy Ubuntu/Debian, it doesn't.


ln -s site-packages venvdir/lib/python3.3/dist-packages

More info

pyvenv-3.4 (Ubuntu 14.04, also Debian)


pyvenv-3.4 venvdir
# Returns an error regarding ensurepip command


pyvenv-3.4 --without-pip venvdir
source venvdir/bin/activate
curl | python
source venvdir/bin/activate

More info

pyvenv-3.4 (Ubuntu 14.04)


The program 'pyvenv-3.4' is currently not installed. You can install it by typing:
sudo apt-get install python3.4



python3 -m venv

Instead of:


More info

pyvenv-3.4 (Ubuntu 15.04)

Works fine!


This comment has been minimized.

ghost commented Sep 26, 2014

Crunchbang is quite buggy. However, by using this command, it works well.

virtualenv --python=python3.4 venv


This comment has been minimized.


denilsonsa commented Sep 26, 2014

@LysanderAkili: What is Crunchbang? What are you talking about?


This comment has been minimized.

Veedrac commented Sep 26, 2014

CrunchBang is a Linux distribution.


This comment has been minimized.

bendavis78 commented Dec 10, 2014

The fix for Ubuntu 14.04 can be shortened to the following:

pyvenv3.4 --without-pip venvdir
curl | venvdir/bin/python

No need to activate the virtualenv when using the python binary directly.


This comment has been minimized.

pikeas commented May 26, 2015

Doesn't work out of the box in 15.04. python3.4 -m venv foo fails with a cryptic error message, and pyvenv/pyvenv-3.4 are not valid commands unless you install python3.4-venv, in which case an old version of pip is installed into the venv.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment