Python2.7 uses the pip command to report an error sys.stderr.write(f "ERROR: {exc}")

Python2.7 uses the pip command to report an error sys.stderr.write(f"ERROR: {exc}")

Problem Description

Recently, I have upgraded pip, and as soon as I use the pip command, an error sys.stderr.write(f"ERROR: {exc}") will be reported, as shown in the figure below.

insert image description here
References:
[1] Python2.7 installation pip error sys.stderr.write(f"ERROR: {exc}")
[2] Python PIP execution command error after upgrading: sys.stderr.write(f"ERROR: {exc}") solution
[3] pip 2.7 error 'sys.stderr.write(f"ERROR: {exc}")'

1. Download pip-20.3.4.tar.gz

Download the highest version of pip that supports Python2.7 from Links for pip , that is, download the pip-20.3.4.tar.gz compressed package, and put it in the "home/download" folder for later use.

Two, install pip-20.3.4

Right-click in the "home/download" folder, open the terminal, directly enter the terminal whose path is download, and run the following command.

sudo easy_install pip-20.3.4.tar.gz

As shown below.
insert image description here

2. Check pip version

Once installed, run the following command to check the pip version.

pip -V

insert image description here

note

The pip in the virtual environment has not yet corresponded to pip20.3.4. Replace the pip file in the virtual environment (/home/anaconda3/envs/py27_tf130/bin) with the pip file under /usr/local/bin, and you can use pip in the virtual environment py27_tf130~~~.

Guess you like

Origin blog.csdn.net/dreaming_song/article/details/116496264