Skip to content

python

Python is a programming language.

Which version is installed

To check which versions of python is present on our machine just run:

python -V
python2 -V
python3 -V

Your can choose which version should use has default with;

sudo update-alternatives --config python3

In the prompt you need to specify the program number you want to use by default.

Be careful with a selection of versions, not to touch the python (python2), just use python3. Python 2.7 written in a variety of system tools, and if you try to run them the wrong version of the interpreter, then nothing happens and it could break your system.

For Mint user be aware that for some reason installing python 3.6 with cinnamon could breaks your system as well.

Install Python 3.6 from source

Step by step guide to install Python 3.6 and pip3 in Mint/Ubuntu/Raspbian

  • Download Python-3.6.1.tar.xz from https://www.python.org/
wget https://www.python.org/ftp/python/3.6.7/Python-3.6.7.tar.xz
  • Unzip the file and keep the folder in home directory.

  • In terminal from that directory and perform the following commands:

./configure
make
make test
sudo make install

This will install Python 3.6 but pip3 may not be working.

  • Install necessary modules using:
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
  • Now write the following to re run the installation:
sudo make
sudo make install
  • Then you can install packages with Python 3.6 using pip3 command. For example:
sudo pip3 install mkdocs

Last words before you broke your system

May the Force be with you,
Good Luck!!!