Skip to content

Instantly share code, notes, and snippets.

@iscle
Last active October 26, 2025 14:04
Show Gist options
  • Save iscle/66e946553e74a883b4494d3b6df0ee82 to your computer and use it in GitHub Desktop.
Save iscle/66e946553e74a883b4494d3b6df0ee82 to your computer and use it in GitHub Desktop.
Install python2.7 on Ubuntu 23.04 as "python"
wget https://www.python.org/ftp/python/2.7.18/Python-2.7.18.tgz
tar xzf Python-2.7.18.tgz
cd Python-2.7.18
sudo ./configure --enable-optimizations
sudo make altinstall
sudo ln -s "/usr/local/bin/python2.7" "/usr/bin/python"
@Lauriy
Copy link

Lauriy commented Oct 4, 2024

You won't be able to make a venv out of that unless you sudo apt-get install libssl-dev before installing

@fixploit03
Copy link

Thank's ^_^

@LeoFalco
Copy link

Você é um anjo 👼

@fixploit03
Copy link

Você é um anjo 👼

where are you from?

@LeoFalco
Copy link

LeoFalco commented May 1, 2025

Você é um anjo 👼

where are you from?

I'm from São José do Rio Preto — Brazil 🇧🇷

@bu1der
Copy link

bu1der commented Jun 12, 2025

Also, works for 24.04.2 LTS. Thanks

@AndreTrevizam
Copy link

thanks

@AdarWa
Copy link

AdarWa commented Aug 6, 2025

Thanks!

@divinity76
Copy link

Installing it as /usr/bin/python2 is fine. Installing it as /usr/bin/python is crazy and asking-for-trouble.

@iscle
Copy link
Author

iscle commented Oct 26, 2025

Installing it as /usr/bin/python2 is fine. Installing it as /usr/bin/python is crazy and asking-for-trouble.

Many old scripts are asking for this. And I guess if you need to use this gist, is because you're trying to run an old script... Otherwise you'd just use python 3.

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