我在Mac上使用终端安装了matplotlib,并且已成功安装。但是,当我尝试导入matplotlib时,会产生ModuleNotFound错误。以下是我的代码和错误消息。
终端:
(myProject) bash-3.2$ python3 -m pip install -U matplotlib
查找索引:https://pypi.doubanio.com/simple要求已经是最新的:/Users/zbao/.local/share/virtualenvs/myProject-opsBTjit/lib/python3.8/site-packages(3.1.3)中的matplotlib已满足要求,跳过升级:/Users/zbao/.local/share/virtualenvs/myProject-opsBTjit/lib/python3.8/site-packages中的python-dateutil> = 2.1(来自matplotlib)(2.8.1)已满足要求,跳过升级:/Users/zbao/.local/share/virtualenvs/myProject-opsBTjit/lib/python3.8/site-packages中的kiwisolver> = 1.0.1(来自matplotlib)(1.1.0)已满足要求,跳过升级:/Users/zbao/.local/share/virtualenvs/myProject-opsBTjit/lib/中的pyparsing!= 2.0.4,!= 2.1.2,!= 2.1.6,> = 2.0.1 python3.8 / site-packages(来自matplotlib)(2.4.6)已满足要求,跳过升级:/Users/zbao/.local/share/virtualenvs/myProject-opsBTjit/lib/python3.8/site-packages中的cycler> = 0.10(来自matplotlib)(0.10.0)已满足要求,跳过升级:/Users/zbao/.local/share/virtualenvs/myProject-opsBTjit/lib/python3.8/site-packages中的numpy> = 1.11(来自matplotlib)(1.18.1)已满足要求,跳过升级:/Users/zbao/.local/share/virtualenvs/myProject-opsBTjit/lib/python3.8/site-packages中的六个> = 1.5(来自python-dateutil> = 2.1-> matplotlib)( 1.14.0)已满足要求,跳过升级:/Users/zbao/.local/share/virtualenvs/myProject-opsBTjit/lib/python3.8/site-packages中的setuptools(来自kiwisolver> = 1.0.1-> matplotlib)(45.2.0 )
IDLE:
import matplotlib
追踪(最近通话):文件“”,第1行,位于导入matplotlibModuleNotFoundError:没有名为“ matplotlib”的模块
感谢您的帮助!如果还有其他需要,请告诉我。抱歉,我对Python还是很陌生。
我在Mac上使用终端安装了matplotlib,并且已成功安装。但是,当我尝试导入matplotlib时,会产生ModuleNotFound错误。以下是我的代码和错误...
从回溯的外观看,好像您已将matplotlib
安装在virtualenv
内。因此,您的选择是: