我在命令提示符中運行此命令pip3 install mysql-connector并顯示:
C:\Users\pc>pip3 install mysql-connector Requirement already satisfied: mysql-connector in c:\users\pc\appdata\local\prog rams\python\python38\lib\site-packages (2.2.9)。
但是ModuleNotFoundError: No module named 'mysql'當我import mysql.connector在 spyder 和 pycahrm 中時,我仍然會得到。
uj5u.com熱心網友回復:
在 Spyder 中,轉到Tools > Preferences > Python interpreter,選擇 Use the following Python interpreter:并從其他安裝中選擇 Python .exe。
Pycharm 的偏好設定中可能有類似的設定。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/445192.html
