Hong Zheng

Python and Virtual Environment

Hong Zheng / 2018-01-05


Download relevant packages:

wget https://sqlite.org/2017/sqlite-autoconf-3210000.tar.gz
wget https://www.python.org/ftp/python/2.7.13/Python-2.7.13.tgz
wget https://pypi.python.org/packages/69/56/f0f52281b5175e3d9ca8623dadbc3b684e66350ea9e0006736194b265e99/setuptools-38.2.4.zip
wget https://pypi.python.org/packages/11/b6/abcb525026a4be042b486df43905d6893fb04f05aac21c32c638e939e447/pip-9.0.1.tar.gz

Install sqlite:

tar -zxf sqlite-autoconf-3210000.tar.gz
cd sqlite-autoconf-3210000
./configure --prefix=/home/users/zhengh42/python/python-2.7.13
make
make install
cd ../

Install Python:

tar -zxf Python-2.7.13.tgz
cd Python-2.7.13
./configure --prefix=/home/users/zhengh42/python/python-2.7.13
make
make install
which python
cd ../

Install Setuptools:

unzip setuptools-38.2.4.zip
cd setuptools-38.2.4/
../python-2.7.13/bin/python setup.py install
cd ../

Install pip:

tar -zxf pip-9.0.1.tar.gz
cd pip-9.0.1/
../python-2.7.13/bin/python setup.py install
cd ../

Install virtualenv:

pip install virtualenv
pip install virtualenvwrapper

Set up a virtual env:

virtualenv --distribute pythonv
source pythonv/bin/activate