Skip to content

Instantly share code, notes, and snippets.

@AlmogCohen
Last active April 26, 2018 18:46
Show Gist options
  • Save AlmogCohen/796c4b44fed80b69674a6a7459af27fd to your computer and use it in GitHub Desktop.
Save AlmogCohen/796c4b44fed80b69674a6a7459af27fd to your computer and use it in GitHub Desktop.
Installing Python 2.7 + pip + pipenv on Centos 6.9

Install yum dependencies

yum -y up date
yum groupinstall -y development && yum install -y bzip2-devel git hostname openssl openssl-devel sqlite-devel sudo tar  wget zlib-dev libffi libffi-devel

Install python2.7

cd /tmp && wget https://www.python.org/ftp/python/2.7.14/Python-2.7.14.tgz && tar xvfz Python-2.7.14.tgz && cd Python-2.7.14 && ./configure --prefix=/usr/local --enable-shared && make && make altinstall

Update libraries bindings

echo "/usr/local/lib" >> /etc/ld.so.conf
ldconfig

Install setuptools + pip

curl https://bootstrap.pypa.io/get-pip.py | python2.7

Install this to avoid pip SSL errors

pip install requests[security]

Some useful python packages

pip install pipenv

Install PyEnv

curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
echo 'export PATH="$HOME/.pyenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment