When i try to from matplotlib import pyplot as plt
Traceback (most recent call last):
File "try.py", line 2, in
from matplotlib import pyplot as plt
File "/home/artivatic/.virtualenvs/test/lib/python3.5/site-packages/matplotlib/init.py", line 124, in
import inspect
File "/usr/lib/python3.5/inspect.py", line 35, in
import dis
File "/home/artivatic/Documents/Santhosh/data/ori_data/dis.py", line 1, in
from matplotlib import pyplot as plt
File "/home/artivatic/.virtualenvs/test/lib/python3.5/site-packages/matplotlib/pyplot.py", line 32, in
import matplotlib.colorbar
File "/home/artivatic/.virtualenvs/test/lib/python3.5/site-packages/matplotlib/colorbar.py", line 28, in
import matplotlib.artist as martist
File "/home/artivatic/.virtualenvs/test/lib/python3.5/site-packages/matplotlib/artist.py", line 10, in
from . import cbook, docstring, rcParams
ImportError: cannot import name 'rcParams'
The issue is that you have a dis.py in your current directory (File "/home/artivatic/Documents/Santhosh/data/ori_data/dis.py", line 1, in) that is shadowing the built in dis module. We import dis (via inspect) in matplotlib/__init__.py, your dis then import matplotlib.pyplot which tries to get things out of the matplotlib module before it has finished setting it's self up.
The solution is to run python from a path that does not have files that shadow the standard library.
I am going to close this because there is nothing we can do at the Matplotlib level to avoid this problem.
Activity
tacaswell commented on Dec 13, 2018
The issue is that you have a dis.py in your current directory (File "/home/artivatic/Documents/Santhosh/data/ori_data/dis.py", line 1, in) that is shadowing the built in dis module. We import dis (via inspect) in matplotlib/__init__.py, your dis then import matplotlib.pyplot which tries to get things out of the matplotlib module before it has finished setting it's self up.
The solution is to run python from a path that does not have files that shadow the standard library.
I am going to close this because there is nothing we can do at the Matplotlib level to avoid this problem.
FerCris commented on May 9, 2019
i have the same problem, uninstall matplotlib and then install again.