python安装mysql-python简明笔记(ubuntu环境)
作者:yiluoAK_47 时间:2024-01-14 17:49:17
本文讲述了python安装mysql-python的方法。分享给大家供大家参考,具体如下:
ubuntu 系统下进行的操作
首先安装了pip工具
sudo apt-get install python-pip
然后使用
sudo pip install mysql-python
安装第三方库.但是此时报错
sh: mysql_config: not found
Traceback (most recent call last):
File "setup.py", line 15, in <module>
metadata, options = get_config()
File "/home/zhxia/apps/source/MySQL-python-1.2.3/setup_posix.py", line 43, in get_config
libs = mysql_config("libs_r")
File "/home/zhxia/apps/source/MySQL-python-1.2.3/setup_posix.py", line 24, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
EnvironmentError: mysql_config not found
原因是没有安装:libmysqlclient-dev
sudo apt-get install libmysqlclient-dev
继续安装 发现 还是报错
mysql.c:29:20: fatal error: Python.h: 没有那个文件或目录,找不到Python头文件,难道wheezy默认没有安装python开发包?
sudo dpkg -l | grep python-dev
果然没有,还真的需要安装:
sudo apt-get install python-dev
MySQL-python就可以编译通过了。
希望本文所述对大家Python程序设计有所帮助。
标签:python,安装,mysql-python
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Python 图形界面框架TkInter之在源码中找pack方法
2021-10-06 05:10:56
![](https://img.aspxhome.com/file/2023/0/121700_0s.png)
Django框架ORM数据库操作实例详解
2024-01-24 00:23:33
![](https://img.aspxhome.com/file/2023/4/112544_0s.png)
asp下为什么韩文字后面显示分号?
2011-03-10 11:07:00
浅谈django url请求与数据库连接池的共享问题
2024-01-26 00:12:40
![](https://img.aspxhome.com/file/2023/1/84931_0s.jpg)
pandas数据清洗,排序,索引设置,数据选取方法
2023-06-13 15:08:45
ASP中如何判断字符串中是否包数字
2008-07-21 12:04:00
Python元组拆包和具名元组解析实例详解
2021-10-17 05:26:58
Navicat Premium15连接云服务器中的数据库问题及遇到坑
2024-01-19 05:41:50
![](https://img.aspxhome.com/file/2023/2/77212_0s.png)
pytest之assert断言的具体使用
2021-11-21 18:04:26
Python中多个数组行合并及列合并的方法总结
2021-10-08 11:00:23
用Dreamweaver MX实现网站批量更新
2009-09-13 18:39:00
![](https://img.aspxhome.com/file/UploadPic/20072/200723113154618s.jpg)
php微信公众号开发(4)php实现自定义关键字回复
2024-04-28 09:45:33
基于FME使用Python过程图解
2023-12-17 07:57:37
![](https://img.aspxhome.com/file/2023/6/120876_0s.png)
Access2003:不支持这种ActiveX控件
2010-12-09 19:59:00
golang gorm框架数据库的连接操作示例
2024-01-21 06:52:56
Go 语言前缀树实现敏感词检测
2024-05-05 09:27:18
![](https://img.aspxhome.com/file/2023/3/128693_0s.png)
SuperSocket 信息: (SpnRegister) : Error 1355。解决方法
2024-01-17 22:54:02
Python grequests模块使用场景及代码实例
2021-08-05 18:30:41
![](https://img.aspxhome.com/file/2023/1/124961_0s.png)
高考要来啦!用Python爬取历年高考数据并分析
2021-06-10 04:08:25
![](https://img.aspxhome.com/file/2023/9/68439_0s.jpg)
SQL Server中字符串函数的用法详解
2024-01-14 05:42:56