Python:在别名下导入模块时出错

时间:2018-07-30 20:47:18

标签: python python-3.x matplotlib

我正在尝试使用别名导入模块,遇到以下错误。有人可以帮忙吗?不知道如何解决该错误。谢谢。

> import matplotlib.pyplot as plt
> 
> Traceback (most recent call last):   File "<input>", line 1, in
> <module>   File "/Applications/PyCharm
> CE.app/Contents/helpers/pydev/_pydev_bundle/pydev_import_hook.py",
> line 21, in do_import
>     module = self._system_import(name, *args, **kwargs)   File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/matplotlib/pyplot.py",
> line 115, in <module>
>     _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()   File
> "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/matplotlib/backends/__init__.py",
> line 62, in pylab_setup
>     [backend_name], 0)   File "/Applications/PyCharm CE.app/Contents/helpers/pydev/_pydev_bundle/pydev_import_hook.py",
> line 21, in do_import
>     module = self._system_import(name, *args, **kwargs)   File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/matplotlib/backends/backend_macosx.py",
> line 17, in <module>
>     from matplotlib.backends import _macosx   File "/Applications/PyCharm
> CE.app/Contents/helpers/pydev/_pydev_bundle/pydev_import_hook.py",
> line 21, in do_import
>     module = self._system_import(name, *args, **kwargs)

> RuntimeError: Python is not installed as a framework. The Mac OS X backend will not be able to function correctly if Python is not insta 

0 个答案:

没有答案