user3597931
user3597931

Reputation:

How do I upgrade from Python 3.4 to Python 3.5 on Ubuntu 14?

I would like to upgrade my python version from 3.4 to 3.5 on Ubuntu. How can I do it? What sort of problems should I avoid in doing it? Do I replace the 3.4 version or do I keep it and run python 3.5 separetely? Many thanks!

Upvotes: 2

Views: 3660

Answers (1)

Charles
Charles

Reputation: 4352

I don't think this is an appropriate question for StackOverflow... probably better suited for one of the sites (Like AskUbuntu).

I would say download the source and install from source. Make sure you do not remove the system python binary!

Installing from source should give you a python binary in /usr/local/bin/ named Python3.5 or something. From there you can set a symbolic link ln -s /usr/local/bin/python3.5 /usr/local/bin/python3 so that the default python3 is 3.5...

Then you can use virtualenv to create projects that will use Python3.5. Make sure your path includes /usr/local/bin!

ie:

$ project="py3app"
$ ./configure
$ make
$ make install
$ ln -s /usr/local/bin/python3.5 /usr/local/bin/python3
$ export PATH=/usr/local/bin:$PATH  # this should be done in your bash_profile or something...
$ virtualenv --python=`which python3` ${project}
$ cd ${project}
$ . bin/activate

Upvotes: 2

Related Questions