python安装mysql-python简明笔记(ubuntu环境)
Jul 06, 2016 pm 01:29 PM本文讲述了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图片操作技巧总结》、《Python数据结构与算法教程》、《Python Socket编程技巧总结》、《Python函数使用技巧总结》、《Python字符串操作技巧汇总》、《Python入门与进阶经典教程》及《Python文件与目录操作技巧汇总》
希望本文所述对大家Python程序设计有所帮助。

Heißer Artikel

Hot-Tools-Tags

Heißer Artikel

Heiße Artikel -Tags

Notepad++7.3.1
Einfach zu bedienender und kostenloser Code-Editor

SublimeText3 chinesische Version
Chinesische Version, sehr einfach zu bedienen

Senden Sie Studio 13.0.1
Leistungsstarke integrierte PHP-Entwicklungsumgebung

Dreamweaver CS6
Visuelle Webentwicklungstools

SublimeText3 Mac-Version
Codebearbeitungssoftware auf Gottesniveau (SublimeText3)

Heiße Themen

Was sind die Vor- und Nachteile des Templatings?

So laden Sie Deepseek Xiaomi herunter

Google AI kündigt Gemini 1.5 Pro und Gemma 2 für Entwickler an

Für nur 250 US-Dollar zeigt Ihnen der technische Leiter von Hugging Face Schritt für Schritt, wie Sie Llama 3 verfeinern

Teilen Sie mehrere .NET-Open-Source-KI- und LLM-bezogene Projekt-Frameworks

Eine vollständige Anleitung zum Debuggen und Analysieren von Golang-Funktionen

So speichern Sie die Evaluierungsfunktion
