无法在python virtual env 2.7中导入mysql连接器模块?

时间:2019-06-16 14:44:20

标签: python-2.7

我能够在python解释器中导入,通过在运行python脚本时反复提示找不到模块。我该如何解决这个问题?

#Python Interpreter#
python
Python 2.7.15+ (default, Nov 27 2018, 23:36:35) 
[GCC 7.3.0] on linux2
>>> import mysql.connector
>>> 


#Python script, shows error#

python MySQLConnect.py 
Traceback (most recent call last):
File "MySQLConnect.py", line 2, in <module>
import mysql.connector
ImportError: No module named mysql.connector

0 个答案:

没有答案