Solve the problem of python setup.py egg_info did not run successfully

Problem Description

When installing some dependent libraries, I encountered a problem, and the error message is as follows

 Preparing metadata (setup.py) ... error error: subprocess-exited-with-error python setup.py egg_info did not run successfully. exit code: 1

Solution

  1. Check if the version of pip is too old

     pip install -U pip
  2. Check if setuptools is installed

     pip install -U setuptools
  3. Check if ez_setup is installed

     pip install ez_setup
  4. If the above method has not been resolved, you can try to search for the whl file corresponding to python version, and then manually install the required library

     # 查看python版本python -V # 安装whl pip install *.whl

This article is transferred from https://xugaoxiang.com/2023/03/15/python-setup-py-egg_info-did-not-run-successfully/
This site is only for collection, and the copyright belongs to the original author.