4

I have Python 2.7.9 and Python 3.4.3 installed in a Ubuntu 15.04 machine. Now I want to upgrade Python 3.4.3 to Python 3.6.1 without affecting the packages which are depended on Python 3.x.x. I have found that Python versions are released as separate package. So, my questions are:

  • Can I actually upgrade Python 3.4.3 to Python 3.6.1?
  • If the answer is no, can I uninstall Python 3.4.3 and install Python 3.6.1 without affecting the installed packages?
  • If the second answer is no, then what will happen if I install Python 3.6.1 using sudo apt-get install python 3.6.1? Can I use Python 3.6.1 without affecting other versions using Python3.6 command in terminal and in virtual environments?

Update

I have installed Python 3.6 from -> https://stackoverflow.com/a/44758621/3129414

arshovon
  • 13,270
  • 9
  • 51
  • 69

1 Answers1

12
  1. Open to terminal window and enter $ python. This will open python interpretor with v2.7.

  2. If your have installed python v3.4 in your system. Then run $ python3, this will open the python interpretor with v3.4.

  3. Yes, python v3.6 can be installed without affecting other versions with the following below steps :

    a) $ wget https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tgz

    b) $ tar xvf Python-3.6.3.tgz

    c) $ cd Python-3.6.3

    d) $ ./configure --enable-optimizations

    e) $ make -j8

    f) $ sudo make altinstall

Then, to run python with v3.6 , run $ python3.6

solanki...
  • 4,982
  • 2
  • 27
  • 29