N
N
niko832011-07-30 09:57:48
Python
niko83, 2011-07-30 09:57:48

Different versions of Python on the same computer

How to install and simultaneously use different versions of Python on the same computer.
Python is used in WEB projects

UPD: linux, nginx, uwsgi are used

Answer the question

In order to leave comments, you need to log in

7 answer(s)
N
niko83, 2011-08-01
@niko83

first install all necessary packages like aptitude install python-pip python-dev libxml2-dev python3 python3-dev python2.6-dev
then virtual space is created
and uwsgi also needs to be built by activating virtual space first! Uwsgi is installed via "pip install uwsgi"

L
lexa0, 2011-08-01
@lexa0

In Gentoo, just specify
USE_PYTHON="2.5 2.6 2.7 3.2"
in make.conf
and the selected python branches are at your service. Packages will be built for all required python versions. And no crutches.

N
niko83, 2011-07-30
@niko83

It seems to have found the right direction, but not completely.
1) I install different versions in inux aptitude install python3 python3.1 python2.7 2
) I create a virtual environment with the required version of the interpreter
virtualenv TESTENV --python=python3 --no-site-packages
I run uwsgi with the config But for some reason the default interpreter version 2,6,6 still starts version 3.1
workers - 4
buffer-size - 32768
сhmod-socket - 666
socket - /tmp/uwsgi.project2.sock
plugins - python
pythonpath - /usr/lib/python3.1
virtualenv - /var/www/env/TESTENV
module - wsgi

S
sgzmd, 2011-07-31
@sgzmd

sudo apt-get install python2.6
sudo apt-get install python2.7
/usr/bin/python2.6
/usr/bin/python2.7
export PYTHON=/usr/bin/pythonX.X then
the idea is clear, right? ;)

A
Alexander G, 2011-07-30
@devosx

I wonder how you use Python3 in your web projects??? what framework?

K
KoXGen, 2011-07-30
@KoXGen

On a working computer, I did this (only for Windows, we were then forbidden to change the system):
1) Download from off. site required versions of python (required Windows Installer)
2) Unpack msi without installing
msiexec.exe /a msi name /qb TARGETDIR= unpacking path
For example: msiexec.exe /a python-2.7.2.msi /qb TARGETDIR=c:/python /2.7
3) Change the version of python you need through environment variables, for example, you can do this:
python-2.7.cmd python-3.2.cmd
@echo off
set PYTHONHOME=c:\python\2.7
set PATH=%PATH%;c:\python\2.7


@echo off
set PYTHONHOME=c:\python\3.2
set PATH=%PATH%;c:\python\3.2

Y
Yuri Shikanov, 2013-02-01
@dizballanze

Here is another good solution - pythonbrew

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question