Skip to content

Instantly share code, notes, and snippets.

@dnavarrom
Last active October 2, 2021 06:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dnavarrom/67c0cb45d8fc6abf98c5c8ce6653e0dd to your computer and use it in GitHub Desktop.
Save dnavarrom/67c0cb45d8fc6abf98c5c8ce6653e0dd to your computer and use it in GitHub Desktop.
Install python 3.7 + pip in linux mint 19 cinnamon
#Step 1 : preconditions
sudo apt-get install build-essential checkinstall
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev \
libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev
#Step 2: download an unpack python
cd /usr/src
sudo wget https://www.python.org/ftp/python/3.7.2/Python-3.7.2.tgz
sudo tar xzf Python-3.7.2.tgz
#Step 3 : compile
cd Python-3.7.2
sudo ./configure --enable-optimizations
#use altinstall used to keep original python, if no python environment use sudo make install
sudo make altinstall
@kelsayed
Copy link

Nice gitst but libffi-dev must be added to the sudo apt-get install to avoid some errors when running python/pip

@dnavarrom
Copy link
Author

Thank you

@Suleman-Elahi
Copy link

It ends with:

  File "/usr/src/Python-3.7.2/Lib/ctypes/__init__.py", line 7, in <module>
    from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'
make: *** [Makefile:1140: altinstall] Error 1

@jstitch
Copy link

jstitch commented Oct 1, 2021

this doesn't installs pip

@Suleman-Elahi
Copy link

this doesn't installs pip

Try sudo apt install python3-pip manually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment