

Pyenv allows you to manage multiple Python versions without sudo for a single user, much like Node.js NVM and Ruby RVM. Virtualenv does feature a "-help" switch to help you, but you basically do: $ virtualenv -p Īnd there you are - all things using Python will "see" the interpreter in the virtualenv, due to environment variables set. Activate your virtualenv, and install Python packages using pip on it.Use virtualenv to create an environment from which you will use your different Python version.use your system's package manager to install "python-setuptools" and "python-virtualenv" (not sure if these are the actual package names).In short, once you have compiled your desired version of Python, do this: So the above method apply as a recommendation even if your system do have more than one version of Python available on apt-get. (It is also a mess to find the module files themselves in a Debian or Ubuntu). This mostly works, but they mess with Python's default directory hierarchy, and some applications fail to use Python in this way. Note that the Debian - and Ubuntu - systems devised a way to run parallel official Python's in /usr, and to have apt-get to install Python packages to both Python versions at once. (And even if one opt to live boldly and not use virtualenvs, installing another python version on the same prefix ( /usr, and even /usr/local) than your system's Python is a source to confusing errors and conflicts). And install other versions of Python (or even the same), to be run with "virtualenv"s - on these other install you install things with pip/setuptools only. So, one of the less error prone way to deal with it is to have separate Python installs in your system - leave the python that came with the system for system scripts and such - on this python, make use of packages installed by your package manager only. The repository is the Pypi - Python Package Index, and packages are installed with pip or the easy_install script, which is part of Python's setuptools package.Īs a rule of thumb, you should not use both the packages installed via pip/setuptools, and packages available to your distro (via apt-get, yum, urpmi, etc.) as they might conflict. Python has got its own package managing facilities, in parallel to the one sets by the Linux distributions (including Ubuntu).
