résolu le problème de version python sans module mysql et mysql.connector

105

J’étais confronté au même problème. Mes détails env – Python 2.7.11 pip 9.0.1 CentOS release 5.11 (Final) Erreur sur l’interprète de python –

>>> import mysql.connector
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named mysql.connector
>>>

Utilisez pip pour rechercher le module disponible –

$ pip search mysql-connector | grep --color mysql-connector-python



mysql-connector-python-rf (2.2.2)        - MySQL driver written in Python
mysql-connector-python (2.0.4)           - MySQL driver written in Python

Installez le mysql-connector-python-rf –

$ pip install mysql-connector-python-rf

Vérifier

$ python
Python 2.7.11 (default, Apr 26 2016, 13:18:56)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-54)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import mysql.connector
>>>

Merci =) Pour python3 et plus tard utilisez la commande suivante : $ pip3 install mysql-connector-python-rf

未经允许不得转载:萌萌Apprentissage » résolu le problème de version python sans module mysql et mysql.connector

J’aime (0) 打赏

Commentaires 0

Protected with IP Blacklist CloudIP Blacklist Cloud
  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏

//下一个脚本特效
//下一个脚本