python installation method under non root permissions

  • 2020-07-21 09:04:52
  • OfStack

When using Python, root users installed global python. Now, root users installed Python version too low, and they do not have root permission to upgrade global Python, so they have to install their own Python under non-ES8en users. Therefore, a copy of how to install python and its associated libraries using non-ES11en users in the Linux environment was reorganized for a rainy day.

Install python

https python repository: / / www python. org/ftp python /, here I choose 2.7.5 version, at the time of installation python, use -- prefix installation path can be specified, the command is as follows:


wget https://www.python.org/ftp/python/2.7.5/Python-2.7.5.tgz
tar -xzf Python-2.7.5.tgz
cd Python-2.7.5
mkdir -p /home/liudiwei/software/python27 
./configure --prefix="/home/liudiwei/software/python27"
make
make install

Install setuptools

setuptools is primarily intended to install pip. Here are all the commands downloaded to install, using the specified path of the above installation

python home/liudiwei software/python27 / bin/python for installation:


wget --no-check-certificate http://pypi.python.org/packages/source/s/setuptools/setuptools-2.0.tar.gz
tar -xzvf setuptools-2.0.tar.gz
cd setuptools-2.0
/home/liudiwei/software/python27/bin/python setup.py install

Install pip

Use pip to install python related library, convenient and simple, here will python setup. py install python for their installation under the specified path of python/home/liudiwei/software/python27 bin/python setup. py install.


wget --no-check-certificate https://pypi.python.org/packages/41/27/9a8d24e1b55bd8c85e4d022da2922cb206f183e2d18fee4e320c9547e751/pip-8.1.1.tar.gz#md5=6b86f11841e89c8241d689956ba99ed7
tar -xzf pip-8.1.1.tar.gz
cd pip-8.1.1
/home/liudiwei/software/python27/bin/python setup.py install

Related articles: