Tag Archives: pip

[Solved] pip Install software Error: Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-build*

pip install software error: Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-build-*(where x is related to the software to be installed)
e.g. pip install pyparsing==1.5.7 install Error: Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-build-WImLdR/pyparsing/
sudo python -m pip install –upgrade –force pip
sudo pip install setuptools==40.8.0

[Solved] python Install pip Error: zipimport.ZipImportError: can’t decompress data; zlib not available



1. Install dependent packages

yum -y install zlib*

2. Recompile Python

#The catalog is based on the production environment itself
[root@wangzy software]# cd Python/
[root@wangzy Python]# ./configure --prefix=/usr/local/python3

#Compile and install
[root@wangzy Python]# make && make install

# re-install
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py

Python — the copied virtual environment PIP command failed to run. Fatal error in launcher: unable to create process using

Original text: https://blog.csdn.net/weixin_ 39278265/article/details/82938270

You need to modify the directory referenced in the pip.exe file in the scripts directory of the virtual environment.

Referring to the original text, I used Notepad + + to open pip.exe, and then searched according to the python path information prompted,

After finding it, replace it with the path of python.exe in the current virtual environment and save it.

Python Via get-pip.py Install pip Error: zipimport.ZipImportError: can‘t decompress data; zlib not availabl

How to Solve error: zipimport.ZipImportError: can‘t decompress data; zlib not availablwget https://bootstrap.pypa.io/pip/2.7/get-pip.py  # python2.7
wget https://bootstrap.pypa.io/get-pip.py  # python3

[[email protected] ~]$ https://bootstrap.pypa.io/get-pip.py
[[email protected] ~]$ sudo python get-pip.py

The error message “zipimport.ZipImportError: can’t decompress data; zlib not available”
It seems that the zlib library is missing and needs to be installed before execution.
Problem solved

1 [[email protected] ~]$ sudo yum install zlib

After the installation was completed, we found that it still reported an error, and a Google search revealed that we needed to install zlib-dev
So we install the zlib library again

1 [[email protected] ~]$ sudo yum install zlib*

This time the installation should be OK, but the result is disappointing, it still gives the same error.
But we have already installed the zlib library, why does it still give us an error?

We need to recompile and install python
Before recompiling, we need to modify the Modules/Setup.dist file in the installation source file to change the

1 #zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz

The comment on this line is removed and becomes

1 zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz

Then compile and install it again (execute the following command in Python’s installation source directory)

1 [[email protected] ~]$ make && make install

Reinstallation completed

1 [[email protected] ~]$ sudo python get-pip.py

Install pip successfully!

[PIP command error] after upgrading the PIP in Ubuntu 16.04, execute the PIP command to report an error sys.stderr.write (F “error: {exc}”)

Get the repair file get-pip.py

    Access get repair file

    Find the download link of the corresponding version file, such as Python 3.5, https://bootstrap.pypa.io/pip/3.5/get-pip.py

    Download using WGet, WGet https://bootstrap.pypa.io/pip/3.5/get-pip.py

    Execute the file using the corresponding version of python, Python 3.5 get pip. Py

How to Solve Error in installing MySQL Python in Pip

Error 1: EnvironmentError: mysql_config not found

Solution: yum install mysql-devel

Error 2: Python.h No such file or directory

For more errors see the following lines.

_mysql.c:29:20: fatal error: Python.h: No such file or directory
#include “Python.h”
compilation terminated.
error: command ‘gcc’ failed with exit status 1

Solution: yum install python-devel.x86_64

In fact, these two errors are one and the same, both are not installed python-devel, only error 2 is 64-bit


Handling method of PIP error in pycharm installation

When using pycharm these days, I found that I reported it when installing the software  module ‘pip’ has no attribute ‘main’  , later, the online methods and analysis error prompts were integrated because there was a packaging in the pycharm installation directory_There are two pieces of code in the tool.py file. There are some problems with the configuration and some changes need to be made

The original code is as follows:

 1 def do_install(pkgs):
 3     try:
 4         import pip
 5     except ImportError:
 6         error_no_pip()
 7     return pip.main(['install'] + pkgs)
10 def do_uninstall(pkgs):
11     try:
12         import pip      
13     except ImportError:
14         error_no_pip()
15     return pip.main(['uninstall', '-y'] + pkgs)

Modify it to the following code:

 1 def do_install(pkgs):
 3     try:
 4         #import pip
 5             try:
 6                     from pip._internal import main   
 7             except Exception:
 8                     from pip import main
 9     except ImportError:
10         error_no_pip()
11     return main(['install'] + pkgs)
14 def do_uninstall(pkgs):
15     try:
16         #import pip
17             try:
18                   from pip._internal import main
19             except Exception:
20                   from pip import main        
21     except ImportError:
22         error_no_pip()
23     return main(['uninstall', '-y'] + pkgs)

If you report an error after modification, it may be a problem of indentation. You must pay attention to the indentation of the code. Python’s indentation requirements can be called abnormal