【发布时间】:2022-01-03 22:22:06
【问题描述】:
我正在尝试安装和使用新的 Python 包,例如mysql:
pip install mysql
Collecting mysqlNote: you may need to restart the kernel to use updated packages.
Using cached mysql-0.0.3-py3-none-any.whl (1.2 kB)
Collecting mysqlclient
Using cached mysqlclient-2.1.0-cp38-cp38-win_amd64.whl (180 kB)
Installing collected packages: mysqlclient, mysql
Successfully installed mysql-0.0.3 mysqlclient-2.1.0
但是,如果我运行代码,我会收到以下错误:
runfile('untitled1.py', wdir='')
Traceback (most recent call last):
File "untitled1.py", line 1, in <module>
import mysql.connector
ModuleNotFoundError: No module named 'mysql'
同样重启内核也没有解决问题:
Python 3.8.12 (default, Oct 12 2021, 03:01:40) [MSC v.1916 64 bit (AMD64)]
Type "copyright", "credits" or "license" for more information.
IPython 7.29.0 -- An enhanced Interactive Python.
Restarting kernel...
我在全新的 Anaconda 2.0.3 安装上使用 Spyder 5.0.0。
【问题讨论】:
标签: python anaconda spyder modulenotfounderror