Reputation:
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
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