[root@scrna-web-01-0001 oe]# pip3 install mysqlclient==2.1.0 Collecting mysqlclient==2.1.0 Using cached mysqlclient-2.1.0.tar.gz (87 kB) Preparing metadata (setup.py) ... error error: subprocess-exited-with-error × python setup.py egg_info did notrun successfully. │ exit code: 1 ╰─> [1 lines of output] ERROR: Can not execute `setup.py` since setuptools isnot available inthe build environment. [endof output] note: This error originates from a subprocess, andis likely not a problem with pip. error: metadata-generation-failed
× Encountered errorwhile generating package metadata. ╰─> See abovefor output.
note: This is an issue withthe package mentioned above, not pip. hint: See abovefor details. [root@scrna-web-01-0001 oe]#
这种一般都是setuptools版本的问题,将setuptools的版本更新的最新:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
[root@scrna-web-01-0001 oe]# pip3 install --upgrade setuptools Requirement already satisfied: setuptools in/usr/local/python3/lib/python3.8/site-packages (41.2.0) Collecting setuptools Downloading setuptools-61.1.0-py3-none-any.whl (1.1 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.1/1.1 MB 9.2 kB/s eta 0:00:00 Installing collected packages: setuptools Attempting uninstall: setuptools Found existing installation: setuptools 41.2.0 Uninstalling setuptools-41.2.0: Successfully uninstalled setuptools-41.2.0 Successfully installed setuptools-61.1.0 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
再次尝试更新:
1 2 3 4 5 6 7 8 9 10
[root@scrna-web-01-0001 oe]# pip3 install mysqlclient==2.1.0 Collecting mysqlclient==2.1.0 Using cached mysqlclient-2.1.0.tar.gz (87 kB) Preparing metadata (setup.py) ... done Using legacy 'setup.py install'for mysqlclient, since package 'wheel'isnot installed. Installing collected packages: mysqlclient Running setup.py install for mysqlclient ... done Successfully installed mysqlclient-2.1.0 WARNING: Running pip as the 'root' user can resultin broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv [root@scrna-web-01-0001 oe]#