So I have Debian machine for my Django production server. I need to install second python (2.7.1) to use with virtualenv. But it always write I don't have some modules, then I have to search manually, apt-install them and rebuild. Is there either a way to resolve the dependencies for building, or pre-compiled .deb with python 2.7.1 for Debian Squeeze? Sorry if this is much of a noobie question, I googled, honestly.
If you wish to use multiple versions of Python on a single machine, then pyenv is a commonly used tool to install and switch between versions. This is not to be confused with the previously mentioned depreciated pyvenv script. It does not come bundled with Python and must be installed separately.
Answer: Yes, we can install both Python 2 and Python 3. We can easily maintain separate environments for Python 2 programs and Python 3 programs on the same computer and not worry about the programs interacting with each other.
Get the Python 2.7.1 sources and compile it manually:
configure --prefix=/path/to/python-2.7
make; make install
Python 2.7 is available for wheezy (testing), so you should be able to install it by adding the testing
repository and doing some APT pinning.
1) add the repository in /etc/apt/sources.list
deb http://ftp.us.debian.org/debian testing main contrib non-free
2) do the actual pinning in /etc/apt/preferences
Package: *
Pin: release n=testing
Pin-Priority: 100
A Pin-Priority
of under 500 basically means that no packages from testing
are installed automatically, so you won't have problems with other packages.
3) install python2.7
from testing
:
aptitude -t testing install python2.7
(or apt-get
if you don't have aptitude
)
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