A
A
Alexander2014-06-09 10:50:58
Python
Alexander, 2014-06-09 10:50:58

Two versions of python (2.7 and 3.3) on Uuntu 12.04. What problems might arise?

What problems may arise for a beginner to learn python if two versions of the language 2.7 and 3.3 are installed on Ubuntu 12.04 and virtualenv is not used? Will the self-installed version 3.3 conflict with the system version 2.7 in some way?
What if a django application was developed on the local machine using virtualenv on python 3.3 and you need to deploy it to the server (Ubuntu 12.04). Do I need to install virtualenv on the server or will it be enough to install python 3.3 and the required modules?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
Semyon Voronov, 2014-06-10
@nwb

What's hard about virtualenv? You also install virtualenv on the server of the version you need python. Then everything is very trivial and simple.

# Убедись что он 2ой версии
apt-cache show python-virtualenv
# Устанавливаешь virtualenv  
apt-get install python-virtualenv  
# Создаешь новый проект, установленные в системы либы не тянешь
virtualenv --no-site-packages project
# Активируешь виртуальное окружение
# Все. Теперь команда pip будет устанавливать все пакеты в твое окружение а не системное
. ./project/bin/activate
# Устанавливаешь Django   
pip install django

If for some reason you do not want a virtual environment, then put the version of pip into the system under the python you need:
$ apt-cache search virtualenv
python-pip - alternative Python package installer
python3-pip - alternative Python package installer - Python 3 version of the package

And you will already be accessing it pip, pip3
As an addition: Debian and Ubuntu have a priority selection mechanism. All it does is switch the link to the required software versions.
This is done using the update-alternatives command.

V
Vlad Zhivotnev, 2014-06-09
@inkvizitor68sl

No, they live separately and are perfectly placed together.
python binary - link to the installed version of python2.x

S
Salavat Sharapov, 2014-06-09
@desperadik

1) Depending on which version you are referring to. Through the command it is simple:
you will call the Python that you have defined in the source.
Conflicts can arise if users on your UBUNTe have different versions of Python defined.
2) It also depends on which user is running (from the user who has python27 or python33 ). But it's always better, IMHO, to have a virtualenv.

V
Vlad Timofeev, 2014-06-09
@PyTiMa

The main thing is not to put Python3 behind the main one - leave Python2.7, otherwise problems with the software will begin. It's better not to be lazy and write python3 in the terminal.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question