1. 程式人生 > >centos 使用pip 安裝mysqldb錯誤

centos 使用pip 安裝mysqldb錯誤

在centos-6.4上pip install mysql-python,報錯如下[[email protected] mysql-python]$ pip install mysql-python

Downloading/unpacking mysql-python

Running setup.py egg_info for package mysql-python

sh: /usr/bin/mysql_config: No such file or directory

Traceback (most recent call last):

File "<string>", line 16, in <module>

File "/tmp/pip-build-sentry/mysql-python/setup.py", line 18, in <module>

metadata, options = get_config()

File "setup_posix.py", line 43, in get_config

libs = mysql_config("libs_r")

File "setup_posix.py", line 25, in mysql_config

raise EnvironmentError("%s not found" % (mysql_config.path,))

EnvironmentError: /usr/bin/mysql_config not found

Complete output from command python setup.py egg_info:

sh: /usr/bin/mysql_config: No such file or directory

Traceback (most recent call last):

File "<string>", line 16, in <module>

File "/tmp/pip-build-sentry/mysql-python/setup.py", line 18, in <module>

metadata, options = get_config()

File "setup_posix.py", line 43, in get_config

libs = mysql_config("libs_r")

File "setup_posix.py", line 25, in mysql_config

raise EnvironmentError("%s not found" % (mysql_config.path,))

EnvironmentError: mysql_config not found

----------------------------------------

工作環境:centOS6.4

解決方法:1.  通過報錯資訊看出是缺少mysql_config,在/usr/bin/下面應該有的mysql_config檔案沒有,網上的解決方案都是apt-get install libmysqlclient-dev,但是apt-get是Debian、Ubuntu系列的網路安裝命令,yum是Redhat、Centos、Fedora是網路安裝命令,接著發現Centos上應該安裝mysql-devel

2.  yum install mysql-devel,發現有衝突,報錯如下:

--> Running transaction check

---> Package mysql-devel.x86_64 0:5.1.69-1.el6_4 will be installed

--> Processing Dependency: mysql = 5.1.69-1.el6_4 for package: mysql-devel-5.1.69-1.el6_4.x86_64

--> Running transaction check

---> Package mysql.x86_64 0:5.1.69-1.el6_4 will be installed

--> Processing Conflict: MySQL-client-5.5.30-1.el6.x86_64 conflicts mysql

--> Processing Conflict: MySQL-server-5.5.30-1.el6.x86_64 conflicts mysql

--> Processing Conflict: mysql-5.1.69-1.el6_4.x86_64 conflicts MySQL

--> Finished Dependency Resolution

Error: mysql conflicts with MySQL-devel-5.5.30-1.el6.x86_64

You could try using --skip-broken to work around the problem

You could try running: rpm -Va --nofiles --nodigest

3.  使用 rpm -qa|grep mysql檢視mysql的安裝情況

mysql-devel-5.5.16-1.el6_4.x86_64

mysql-client-5.5.16-1.el6_4.x86_64

mysql-server-5.5.16-1.el6_4.x86_64

4.  使用rpm -e mysql-devel-5.5.16-1.el6_4.x86_64移除已有的安裝包

5.  再次使用yum install mysql-devel 發現和mysql-server, mysql-client的版本有衝突

6.  去網上尋找相同的版本下載http://downloads.skysql.com/archive/index/p/mysql/v/5.5.16,下載64bit的rpm檔案,使用rpm -ivh MySQL-devel-5.5.16-1.linux2.6.x86_64.rpm安裝

7.  安裝成功後,去/usr/bin/目錄下,發現生成了mysql_config檔案,繼續pip install mysql-python,順利完成。

相關推薦

centos 使用pip 安裝mysqldb錯誤

在centos-6.4上pip install mysql-python,報錯如下[[email protected] mysql-python]$ pip install mysql-python Downloading/unpacking mysql-python Running setup

windows7環境下使用pip安裝MySQLdb

tags tar 2.7 blank window mysqldb lib ref exe 1、首先,需要確定你已經安裝了pip。在Python2.7的安裝包中,easy_install.py和pip都是默認安裝的。可以在Python的安裝目錄先確認,如果\Python27

pip安裝mysqldb報錯

詳細問題:   (windows)python環境安裝MySQLdb第三方包,報錯Microsoft Visual C++ 9.0 is required 解決方法:   下載MySQL_python-1.2.5-cp27-none-win32.whl(http

python pip安裝MySQLdb報錯解決方法

一 進入網站 下載MySQL-python相關軟體。 二 下載後解壓,有兩個安裝包 MySQL-python-1.2.3.win32-py2.7.exe MySQL-python-1.2.3

python的pip安裝MySQLdb和PyQt4出錯以及解決辦法

今天在安裝MySQLdb模組和PyQt4模組的時候出現了無法使用pip直接安裝的問題,如圖。 (因為之前出錯的時候沒有截圖,所以嘗試安裝PyQt5,錯誤和之前的一樣) 思考了下,換了一種安裝思路。 首先從網上下載.whl檔案,我下載的這兩個模組的whl

centos7 pip安裝軟體錯誤記錄

安裝ansible 1. fatal error: ffi.h: No such file or directory 解決方法:                sudo yum groupinstall 'Development Tools'                

Mac下Python使用Pip安裝錯誤解決

Found existing installation: six 1.4.1 DEPRECATION: Uninstalling a distutils installed project (six) has been deprecated and will

解決pip安裝mysqldb or pymysql等失敗

rec recent ada all rom .py https org package Collecting mysql Using cached https://files.pythonhosted.org/packages/bf/5f/b574ac9f70811

Windows下使用pip安裝MySQLdb

進入\Python27\Scripts 目錄執行cmd,執行pip命令來安裝 3、安裝MySQLdb之前先要安裝wheel,執行pip install wheel命令進行安裝 4、下載MySQL_python-1.2.5-cp27-none-win32.whl安裝包,在下載

樹莓派pip安裝錯誤

報錯:ValueError: bad marshal data (unknown type code) python出現這玩意,一般來說是你的前後的編譯器有不相同造成的。前後安裝了2個版本的Py一個是2.7 一個是3.5 的所以在2.7的時候跑了,造成了安裝3.5之後就會出問

CentOS安裝MySQLdb

目的 好久不用Python寫程式碼了,最近需要寫一個簡單的小程式,整理了一下安裝MySQLdb遇到的問題。 測試是否安裝MySQLdb >>> import MySQLdb ImportError: No module named MyS

python3.7.3使用pip安裝mysqldb報錯,3.7.3後改為pymysql

ESS rom python match from whl not find found org (xiao) [[email protected] web]$ pip install mysqldbCollecting mysqldbCould not find

Centos安裝python的MySQLdb模組若干錯誤總結

1、下載,解壓python-mysql 2、執行python setup.py install 3、Error1: 報錯mysql_config not found     首先查詢mysql_config的位置,使用find / -name mysql_config

CentOS 使用yum命令安裝出現錯誤提示”could not retrieve mirrorlist http://mirrorlist.centos.org ***”

cannot log 命令提示符 error can fresh refresh nbsp ould 剛安裝完CentOS,使用yum命令安裝一些常用的軟件,使用如下命令:yum –y install gcc. 提示如下錯誤信息: Loaded plugins: fast

centos 6 安裝python2.7和pip

connect root 步驟 lan cts download evel ror test 由於scrapy1.0的發布,想在Linux上測試,所以安裝了centos6.6;但是它的python版本為2.6,很多東西都不支持,所以需要升級為2.7; 首先是在window

CentOS 7安裝Samba 4.6 版本步驟及錯誤解決方法

style chmod tab root 必須 共享文件夾 默認 mini div 首先通過這次教訓,讓我養成一個好習慣:備份 備份 備份 不管做什麽配置或者更改什麽東西之前先做好備份! 還有我本身的一個壞毛病:眼高手低! 工廠有一臺服務器,由以前的運維裝的S

windows下python3.6 通過pip安裝Twisted模塊報utf-8錯誤的解決辦法

報錯 tps www div gpo scrapy href cnblogs win 1.去這個網站 https://www.lfd.uci.edu/~gohlke/pythonlibs/ 2.下載Twisted?17.9.0?cp36?cp36m?win32.whl或Tw

centos安裝pip時失敗

release linux epel擴展源 解決 package tps www. post 社區 No package pip available.Error: Nothing to do 解決方法:需要先安裝擴展源EPEL。EPEL(http://fedoraproje

使用pip安裝包提示TLS證書錯誤解決辦法

col conf 新版本 HERE pin tls inux 執行 沒有 最近有不少同學在使用pip安裝python包的時候,經常會出現以下類似的錯誤: Could not fetch URL https://pypi.python.org/simple/pytest-x

python2.7使用pip安裝包一直錯誤

python2.7使用pip安裝包一直錯方法:1、在Python的安裝目錄C:/Python27/Lib/裏找到mimetypes.py文件;2、打開mimetypes.py文件,在import結束後添加以下代碼:import sysreload(sys)sys.setdefaultencoding('