我试图通过pip安装Scipy,但它不会起作用。它说已经安装了,但是当我尝试导入模块时,它会给我带来错误。
from matplotlib import pyplot as plt
错误:
Traceback (most recent call last):
File "C:\Users\TimGF\Documents\Coding\Python\numpy.py", line 1, in <module>
from matplotlib import pyplot as plt
File "C:\Python36\lib\site-packages\matplotlib\__init__.py", line 127, in <module>
from . import cbook
File "C:\Python36\lib\site-packages\matplotlib\cbook\__init__.py", line 35, in <module>
import numpy as np
File "C:\Users\TimGF\Documents\Coding\Python\numpy.py", line 1, in <module>
from matplotlib import pyplot as plt
File "C:\Python36\lib\site-packages\matplotlib\pyplot.py", line 31, in <module>
import matplotlib.colorbar
File "C:\Python36\lib\site-packages\matplotlib\colorbar.py", line 32, in <module>
import matplotlib.artist as martist
File "C:\Python36\lib\site-packages\matplotlib\artist.py", line 15, in <module>
from . import cbook, docstring, rcParams
ImportError: cannot import name 'rcParams'
编辑:原来,问题是,我打电话给我的文件&#34; matplotlib.py&#34;。
答案 0 :(得分:0)
原来我是超级傻瓜,我只需将python文件重命名为&#34; matplotlib.py&#34;因为它混淆了剧本。