Skip to content

Instantly share code, notes, and snippets.

@4k4xs4pH1r3
Forked from lukaslundgren/python27_on_debian.sh
Last active June 22, 2022 23:15
Show Gist options
  • Save 4k4xs4pH1r3/2196035667b41107d903ebc5a771d956 to your computer and use it in GitHub Desktop.
Save 4k4xs4pH1r3/2196035667b41107d903ebc5a771d956 to your computer and use it in GitHub Desktop.
How to install python 2.7 on debian
sudo -i
for pkg in $(dpkg --get-selections | egrep -v 'deinstall' | egrep python | awk '{print $1}'); do apt-get -y --allow-downgrades install --reinstall $pkg ; done
sudo apt install aptitude -y && sudo aptitude install libsqlite3-dev -y && sudo wget https://www.python.org/ftp/python/2.7.18/Python-2.7.18.tgz && sudo tar -xzf Python-2.7.18.tgz && cd Python-2.7.18
./configure --prefix=/usr --prefix=/home/python27 --enable-shared --enable-loadable-sqlite-extensions --enable-optimizations
sudo make && sudo make install
./configure; make libinstall; make sharedinstall
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 10
sudo update-alternatives --set python /usr/bin/python2.7 && cd
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py
python get-pip.py
/usr/bin/python -m pip install --upgrade pip
apt install python3 python3-pip ipython3 && pip3 -V
curl https://bootstrap.pypa.io/get-pip.py | sudo python3
apt install python-pip -y
pip2 -V && pip -V
(optional)
wget http://peak.telecommunity.com/dist/ez_setup.py
sudo python2.7 ez_setup.py
sudo easy_install-2.7 virtualenv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment