错误命令出错,退出状态为 1 pip install [英] error command errored out with exit status 1 pip install
本文介绍了错误命令出错,退出状态为 1 pip install的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用 python vitrualenv,当我想通过 pip install
安装任何软件包时,我会出错:
I use python vitrualenv and when I want to install any packages by pip install <package name>
I take that error:
ERROR: Command errored out with exit status 1:
command: /home/user/project/some_project_name/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-sifdsjjx/MySQL-python/setup.py'"'"'; __file__='"'"'/tmp/pip-install-sifdsjjx/MySQL-python/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-sifdsjjx/MySQL-python/pip-egg-info
cwd: /tmp/pip-install-sifdsjjx/MySQL-python/
Complete output (7 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-sifdsjjx/MySQL-python/setup.py", line 13, in <module>
from setup_posix import get_config
File "/tmp/pip-install-sifdsjjx/MySQL-python/setup_posix.py", line 2, in <module>
from ConfigParser import SafeConfigParser
ModuleNotFoundError: No module named 'ConfigParser'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
我使用 python 3.7.0点子 20.0.2
I use python 3.7.0 pip 20.0.2
推荐答案
尝试升级 setuptools
:
pip install --upgrade setuptools
<小时>
更新
如评论中所述,您正在尝试安装 MySQL-python
这是一个非常古老的包(最后一个版本是在 2014 年发布的).
As mentioned in the comments, you are attempting to install MySQL-python
which is a very old package (last release was made back in 2014).
然而,您可以安装一个更新的,名为 MySQLdb
这是一个围绕 C 模块的瘦 python 包装器,它实现了 MySQL 数据库的 API:
You can however install a more recent one, called MySQLdb
which is a thin python wrapper around C module which implements API for MySQL database:
pip install mysqlclient
这篇关于错误命令出错,退出状态为 1 pip install的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文