2017-04-17 5 views
1

Voici les étapes que j'ai suivies. Je veux DONOT déranger Pythn2.6 qui est déjà sur le serveur, mais je veux installer Python 2.7 séparemmentInstallation de Python 2.7 centos avec MYSQLDB

1) sudo yum install python27 python27-pip 

2) sudo yum -y install python27-devel libxslt-devel libffi-devel openssl-devel3) sudo yum install python27-MySQL-python Je reçois l'erreur suivante dans l'installation mysqldb

Collecting MySQL-python 
    Using cached MySQL-python-1.2.5.zip 
    Complete output from command python setup.py egg_info: 
    sh: mysql_config: command not found 
    Traceback (most recent call last): 
     File "<string>", line 1, in <module> 
     File "/tmp/pip-build-ixxaPu/MySQL-python/setup.py", line 17, 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 

    ---------------------------------------- 
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-ixxaPu/MySQL-python/ 

S'il vous plaît aidez-moi résoudre ou comment déboguer le problème


Répondre

1

Après avoir lutté un jour j'ai trouvé la réponse de nombreux Blogs sa y installer

mysql-devel 

Mais installe ancienne version de MySQL 5.1 Maintenant, nous utilisons Percona donc j'ai essayé de chercher le client Percona version actuelle

yum list installed | grep -i percona 

et installé la même version Devel Voici la commandes

sudo yum install Percona-Server-devel-56.x86_64 

Cette installé la mysql_config vous pouvez recouper avec

which mysql_config 

puis installez

sudo pip2.7 install MySQL-python 

c'est tout son travail

1

Les éléments suivants doivent également travailler:

sudo yum whatprovides mysql_config 

Cette liste les paquets qui contiennent des noms de fichiers qui correspondent à la chaîne mysql_config .

Ensuite, installez simplement l'un des paquets suggérés.

+0

Travaillé parfaitement pour moi en essayant de configurer Python sur Centos7/Plesk. A dû installer mariadb-devel, –