Install Python applications on Linux

· Read in about 1 min · (173 Words)

Python is very popular. A lot of bioinformatics softwares are written in Python, so we have to learn how to install Python applications, particularly when you have no ROOT privilege.

Install private Python firstly

wget https://www.python.org/ftp/python/2.7.8/Python-2.7.8.tgz
tar -zxcf Python-2.7.8.tgz
cd Python-2.7.8
./configure --prefix=/db/home/shenwei/local/app/python
make
make install

echo export LOCAL_PYTHON=/db/home/shenwei/local/app/python >> ~/.bashrc
echo export PYTHONPATH=\$LOCAL_PYTHON:\$LOCAL_PYTHON/lib/python2.7/site-packages:\$PYTHONPATH >> ~/.bashrc
echo export PATH=\$PYTHONPATH/bin:\$PATH >> ~/.bashrc
. ~/.bashrc

Check

which python
~/local/app/python/bin/python

Install  pip, so we can easily install python modules.

wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py

Check

wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py

Example: to install pprospector

# download pprospector-1.0.1.tar.gz
cd pprospector-1.0.1

python setup.py
PyCogent not installed but required. (Is it installed? Is it in the current user's $PYTHONPATH or site-packages?) See http://pycogent.sourceforge.net.

PyCogent missing, So, we use pip to install PyCogent (and Numpy,  Matplotlib).

pip install Numpy
pip install cogent
pip install Matplotlib
pip install Sphinx # fail to install in this case

Finally, we could run setup.py according to the install tutorial .

python setup.py install --install-scripts=/db/home/shenwei/local/bin/ --install-purelib=$LOCAL_PYTHON/lib/python2.7/site-packages

install python3 modules

yum install python3-setuptools
python3 -m pip install pandas