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

Example Analysis of upgrading python and installing pip under Linux

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you the example analysis of upgrading python and installing pip under Linux. I believe most people don't know much about it, so share this article for your reference. I hope you will gain a lot after reading this article. Let's learn about it together.

Linux version upgrade:

1. First make sure that the version of python that comes with the Linux operating system is the same as the version you need.

All python versions are downloaded from https://www.python.org/ftp/python/.

2. Download wget https://www.python.org/ftp/python/2.7.11/Python-2.7.11.tgz

3. Decompression

Tar-zxvf Python-2.7.11.tgz

Enter the Python-2.7.11 directory and enter

. / configure

Make

Make install

4. Check whether the python version is the default version of the system at this time

Execute:

Mv / usr/bin/python / usr/bin/python2.6

Ln-s / usr/local/bin/python2.7 / usr/bin/python

Check again that you have updated to the version you want to install

Pip installation

1. A get-pip.py; is provided in python. Below is the address.

Https://bootstrap.pypa.io/get-pip.py

2. Execute curl https://bootstrap.pypa.io/get-pip.py under Linux | python to download and install

It's convenient to pack whatever bag you want.

Pip install xxx

Note: after upgrading the python version, your yum command may not be used, because the yum command is written in python.

# vi / usr/bin/yum # Open the yum command file and change the startup address of the first line of the script

Change to / usr/bin/python2.6 in step 4 above for ok

Install pip under supplementary Windows:

Shortcut method:

Find the C:\ Python27\ Scripts directory: run easy_install.exe pip directly and install pip

Pip upgrade:

When we use pip to install modules, there are times when the pip version is too low

One command to resolve:

Python-m pip install-U pip

Both linux and Windows support this command

The above is all the contents of the article "sample Analysis of upgrading python and installing pip under Linux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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

Servers

Wechat

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

12
Report