pip报错解决:EnvironmentError: mysql_config not found

centos7下使用python类库MySQL-python操作mysql。
pip安装类库:
pip install MySQL-python
报错提示:
mariadb EnvironmentError: mysql_config not found

安装mysql-devel:
yum -y install mysql-devel

执行pip install MySQL-python,又出现报错:
error: command ‘gcc‘ failed with exit status 1

这是由于没有正确安装Python开发环境导致。

Centos/Fedora下
yum install python-devel
yum install libevent-devel
easy_install gevent
或者
pip install gevent
把环境更新下
yum groupinstall ‘development tools‘

如果是Debin/Ubuntu下
Python2:apt-get install python-dev
Python3:apt-get install python3-dev
可能需要libevent库
apt-get install libevent-dev
最后更新下开发环境
apt-get groupinstall ‘development tools‘

再次执行pip install MySQL-python

ps:如果本地已经安装了mysql,要安装和mysql版本匹配的mysql-devel

原文地址:https://www.cnblogs.com/zqifa/p/python-mysql-3.html

时间: 2024-08-08 11:57:01

pip报错解决:EnvironmentError: mysql_config not found的相关文章

[已解决]EnvironmentError: mysql_config not found

$ pip install MySQL-python==1.2.5 报错: EnvironmentError: mysql_config not found 原因是缺少包 libmysqlclient-dev $ sudo apt-get install libmysqlclient-dev

python pip安装 mysqlclient 报错 raise EnvironmentError("%s not found" % (_mysql_config_path,)) OSError: mysql_config not found

raise EnvironmentError("%s not found" % (_mysql_config_path,)) OSError: mysql_config not found 解决办法 yum install mysql-devel python pip安装 mysqlclient 报错 raise EnvironmentError("%s not found" % (_mysql_config_path,)) OSError: mysql_confi

解决'python -m pip install --upgrade pip' 报错问题

再安装包的时候提示 You are using pip version 9.0.3, however version 10.0.1 is available.You should consider upgrading via the 'python -m pip install --upgrade pip' command.12而我按照要求运行python -m pip install --upgrade pip 后仍然无法成功升级,提示如下: (venv) D:\Fish>python -m

CentOS7.5 Python3安装pip报错:ModuleNotFoundError: No module named '_ctypes' --Python3

1.问题:pyhontModuleNotFoundError: No module named '_ctypes'  操作系统:CentOS7.5 安装完Pyhotn3后(如何安装Python3,安装后我的python.python3命令指向python3;python2命令和python2.7指向python2.7),发现没有安装两个版本都没有pip.所以下载好pip包,用系统自带python2安装如下所示: [root@VM_39_157_centos ~]# wget https://fi

解压版本Python,手动安装pip报错,pip得到报错" No module named 'pip' "

解压版本Python,手动安装pip报错 λ pip Traceback (most recent call last): File "runpy.py", line 193, in _run_module_as_main File "runpy.py", line 86, in _run_code File "D:\tools\python-3.8.1-embed-amd64\Scripts\pip.exe\__main__.py", line

Oracle11g 启动报错ORA-00845: MEMORY_TARGET not supported on this system报错解决

ORA-00845: MEMORY_TARGET not supported on this system报错解决 Oracle启动报错 ORA-00845: MEMORY_TARGET not supported on this system报错解决 SQL> startup ORA-00845: MEMORY_TARGET not supported on this system 查看原本大小 [[email protected] oracle]# df -h|grep shm tmpfs

【Unity3D】生成工程报错解决—UnityEditor.HostView:OnGUI() Error building Player: Couldn't build player because of unsupported data on target platform.

错误 错误1:An asset is marked as dont save, but is included in the build: unityEditor.HostView:OnGUI() 错误2:Building - Failed to write file: sharedassets0.assetsUnityEditor.HostView:OnGUI() 错误3:Error building Player: Couldn't build player because of unsup

quick3.3final版创建项目报错解决

quick3.3final版创建项目报错解决 今天新下载了quick3.3final版,于是安装,创建项目,打开player新建项目如下图 然后点击创建,就发生了如下错误,相信应该有不少朋友会碰到的 首先,这里有两个错误 1.PHP Notice:  Undefined index: extracmd in /Users/wangmeng/Documents/quick-3.3/quick/bin/lib/quick/ProjectCreator.php on line 117 这是117行有未

Eclipse @override报错解决

关键字: eclipse @override 报错 解决 第一种解决方案: @Override是JDK5 就已经有了,但有个小小的Bug,就是不支持对接口的实现,认为这不是Override而JDK6 修正了这个Bug,无论是对父类的方法覆盖还是对接口的实现都可以加上@Override 修改你的eclipse指定的编译器版本在选项里的java compiler中指定版本至少在5.0以上 在myEclipse中改变编译器的方法:Project->Properties->Java Compiler-