How do I install python 3.5.2 ubuntu 2017

Katılım
19 Ocak 2017
Tepki puanı
343
Rating - 0%
how install python 3 on ubuntu :)


$ python -V

it should return 'Python 2.7.12'

It is recommended that we don't try to modify/uninstall this default package of python because there could be many other system files/applications depending on it, and it might create some unexpected errors or issues if we uninstall this default python package.

So, to use the latest version of python, it would be better to go for creating a virtual environment ('virtualenv'). This is a module inside python which facilitates us to use multiple python versions on the same system.

Step-1: First install python3 -

$ sudo apt-get update
$ sudo apt-get install python3

Step-2: Now install 'virtualenv'-

$ pip install virtualenv

Step-3: Now set the path of virtualenv to your desired directory. lets first create a desired directory-

$ mkdir MYENV

it will create a folder in the current directory with the name 'MYENV'

Step-4: set the path of virtualenv to the created(desired) directory-

$ sudo virtualenv -p python3 MYENV

Step-5: Activate the virtualenv

$ source MYENV/bin/activate

done.. you should be able to get (MYENV) as prefix in the terminal command line. Now run below command

$ python -V

it should return 'python 3.5.2'


 
131,582Konular
3,269,356Mesajlar
315,469Kullanıcılar
TheELosexSon Üye
Üst Alt