Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of installing Python and related libraries off-line for non-root users in Linux environment

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "how to install Python and related libraries offline for non-root users in Linux environment". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to install Python and related libraries offline for non-root users in Linux environment.

Without Root permission and without external network, it is impossible to upgrade and install related libraries globally, so I have sorted out a list of how to use non-root users to install python and related libraries in Linux environment for a rainy day.

Step 1: install python

Python version library https://www.python.org/ftp/python/. I choose version 2.7.14 here. When installing python, use-- prefix to specify the installation path. The command is as follows:

Download the corresponding package from the public network and upload it to the host: https://www.python.org/ftp/python/2.7.14/Python-2.7.14.tgz

Tar-xzf Python-2.7.14.tgz

Cd Python-2.7.14

Mkdir-p / home/regn/python27

. / configure-- prefix= "/ home/regn/python27"

Make

Make install

Export PATH=/home/regn/python27/bin:$PATH # needs to configure the environment and can be added to the environment. Bashrc

Step 2: install setuptools

Setuptools is mainly in preparation for installing pip. Here are all the commands from download to installation, which are installed using the python of the specified path installed above:

Download the corresponding package from the public network and upload it to the host: http://pypi.python.org/packages/source/s/setuptools/setuptools-2.0.tar.gz

Tar-xzvf setuptools-2.0.tar.gz

Cd setuptools-2.0

Python setup.py install

Step 3: install pip

Use pip to install python related libraries, which is convenient and simple.

Download the corresponding package from the public network and upload it to the host: https://pypi.python.org/packages/c4/44/e6b8056b6c8f2bfd1445cc9990f478930d8e3459e9dbf5b8e2d2922d64d3/pip-9.0.3.tar.gz

Tar-xzf pip-9.0.3.tar.gz

Cd pip-9.0.3

Python setup.py install

Install other related libraries

Log in to the website: https://pypi.python.org/pypi searches for the appropriate library files

Download: mysql_connector_python-8.0.6-cp27-cp27m-manylinux1_x86_64.whl # mysql Library

Cx_Oracle-6.2.1-cp27-cp27m-manylinux1_x86_64.whl # Oralce Library

Elasticsearch-6.2.0-py2.py3-none-any.whl # elasticsearch Library

Upload to the host:

Run: pip install mysql_connector_python-8.0.6-cp27-cp27m-manylinux1_x86_64.whl

Pip install cx_Oracle-6.2.1-cp27-cp27m-manylinux1_x86_64.whl

Pip install elasticsearch-6.2.0-py2.py3-none-any.whl

Error installing elasticsearch Times, prompt to install

/ simple/urllib3/ download urllib3-1.22-py2.py3-none-any.whl from https://pypi.python.org/pypi

Pip install urllib3-1.22-py2.py3-none-any.whl

Pip install elasticsearch-6.2.0-py2.py3-none-any.whl

At this point, I believe you have a deeper understanding of "the method of offline installation of Python and related libraries for non-root users in the Linux environment". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report