0

This question already has an answer here:

I would like to upgrade my python3 version from 3.2.3 to 3.3.x version. I am using Ubuntu 12.04

Referred this link. Is it the same procedure to upgrade the python version?

If so, then what must be run instead of sudo apt-get build-dep python3.4?

I have a doubt in the procedure because it is updating in same version line 3.4.x. Please refer and say so as to avoid further problems.

Edit 1: Also referred this link How do I install python 3.3 but did not help me.

marked as duplicate by muru, MadMike, Eric Carvalho, Luís de Sousa, Mark Kirby Jun 8 '16 at 15:47

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • I tried it out but does not replace the default version – anand mbs Jun 7 '16 at 9:34
  • There are multiple answers there. Which ones did you try? – muru Jun 7 '16 at 9:35
  • All the answers are to install the python3.3 version in virtualenv and not in default location. Most of the answers are similar and tried the top 3. – anand mbs Jun 7 '16 at 9:38
  • What? The very first answer is to install python3.3 from the Deadsnakes PPA, which installs /usr/bin/python3.3, not in a virtualenv. Please read through. – muru Jun 7 '16 at 9:39
  • I did not raise the question without trying it @muru. It did not replace the default version – anand mbs Jun 7 '16 at 9:40
3

While relatively little in 12.04's core system relies on Python 3, I would always and in the strongest terms recommend that you leave the default Python environments to themselves.

That is to say:

  • Don't mess with the /usr/bin/python{,2,3} etc links.
  • Don't sudo {pip install,easy_install} anything into the system's site packages.

This is contrary to what you say you want to do but seriously, given you don't already know how to do this, you're a very long way away from knowing how to fix a broken system.

In your case, I'd recommend compiling your version of Python (in your home directory or even in /opt/) and then creating a virtualenv (venv) from that. Inside the virtualenv, python (and everything that uses it) will refer to the version of Python used during the creation of that environment.

cd project_directory
/path/to/python -m venv venv
. venv/bin/activate
pip install whatever
  • So according to the answer and the comments, I avoid the updation of the python3 version. But what shall I do to install pip3? – anand mbs Jun 7 '16 at 10:27
  • You can run this script using the specific version of python to get pip for it, and then run this version and execute pip as a module, like /opt/python3/bin/python3.5 -m pip install emojitations. More info at pypa.io. – Stefano Palazzo Jun 7 '16 at 10:45
  • to avoid further problems, I am not going to update the python3 version and also going to skip installing pip3. No more options. – anand mbs Jun 7 '16 at 11:04

Not the answer you're looking for? Browse other questions tagged or ask your own question.