Skip to content

Instantly share code, notes, and snippets.

@saiful7
Forked from lukaslundgren/python27_on_debian.sh
Created August 20, 2023 19:21
Show Gist options
  • Save saiful7/44322960b4e8b5f269a10de4a366c6cb to your computer and use it in GitHub Desktop.
Save saiful7/44322960b4e8b5f269a10de4a366c6cb to your computer and use it in GitHub Desktop.
How to install python 2.7 on debian
sudo apt-get install build-essential libsqlite3-dev zlib1g-dev libncurses5-dev libgdbm-dev libbz2-dev libreadline5-dev libssl-dev libdb-dev
wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz
tar -xzf Python-2.7.3.tgz
cd Python-2.7.3
./configure --prefix=/usr --enable-shared
make
sudo make install
cd ..
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.6 20
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 10
sudo update-alternatives --set python /usr/bin/python2.6
wget http://peak.telecommunity.com/dist/ez_setup.py
sudo python2.7 ez_setup.py
sudo easy_install-2.7 virtualenv
@oxfemale
Copy link

oxfemale commented May 2, 2024

On Debian 1:6.6.28-1+rpt1 (2024-04-22) aarch64:
"./configure --prefix=/usr --enable-shared" - error can't g++, so need manual add path to g++
./configure --prefix=/usr --enable-shared --with-cxx-main=/usr/bin/g++

@oxfemale
Copy link

oxfemale commented May 2, 2024

and on last Debian sudo apt-get install build-essential libsqlite3-dev zlib1g-dev libncurses5-dev libgdbm-dev libbz2-dev libreadline5-dev libssl-dev libdb-dev error, need libncurses6-dev, so correct string be:
sudo apt-get install build-essential libsqlite3-dev zlib1g-dev libncurses5-dev libgdbm-dev libbz2-dev libreadline6-dev libssl-dev libdb-dev

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