New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cannot import name rcParams #1280
Comments
This is not a bug. The problem is that subprocess is trying to import the python library select module, but it is instead finding your own select.py, and that is trying to pull in all of pylab, while matplotlib.widgets was still in the early stages of importing matplotlib/init.py. You need to rename your select.py to avoid the name clash, or run from a different directory, or take spz out of your PYTHONPATH, if that is the way your select is being found. |
OS: Ubuntu 16.04 When i try to I am facing the same issue
Any solution? |
Ah, you seem to have some sort of name collision going on. you have a
module called `dis.py`, which is taking precedence over the standard
library module of the same name. Now, this shouldn't be happening in
python3.5. Could you double-check which version of python you are running?
…On Thu, Dec 13, 2018 at 6:04 AM santhoshav15 ***@***.***> wrote:
OS: Ubuntu 16.04
Python Version: 3.5.2
Matplotlib Version: 3.0.2
When i try to from matplotlib import pyplot as plt
I am facing the same issue
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'
Any solution?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1280 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AARy-KKAIUA8uGJ13X4STmRlLph1IZrwks5u4jQygaJpZM4AKSQk>
.
|
@WeatherGod I have The issue got fixed obviously after i changed the name of |
I'm getting the same error under very similar circumstances (importing matplotlib pyplot with a failure in the attempt to load colorbar, then martist, then rcParams), but I do not have dis.py or any other python (.py) files in my working directory. However, I think (but am not sure) that the problem started after I installed statsmodels. I'm running a jupyter notebook within a conda environment with python 3.6 and matplotlib-3.0.2-py36_1002. |
without seeing your traceback, we can't determine if there is some other
file that is getting caught up in the import tree.
…On Thu, Jan 31, 2019 at 6:37 PM John Strong ***@***.***> wrote:
I'm getting the same error under very similar circumstances (importing
matplotlib pyplot with a failure in the attempt to load colorbar, then
martist, then rcParams), but I do not have dis.py or any other python (.py)
files in my working directory. However, I think (but am not sure) that the
problem started after I installed statsmodels. I'm running a jupyter
notebook within a conda environment with python 3.6 and
matplotlib-3.0.2-py36_1002.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1280 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AARy-I6vzJKZteVV8Ba4fyNKWSPLy2MBks5vI34jgaJpZM4AKSQk>
.
|
Thanks for taking time to respond. Here's the traceback: After the import
|
That is really strange. Those items should be coming from
site-packages/matplotlib/__init__.py. Can you check that that file is valid
in your install?
…On Fri, Feb 1, 2019 at 8:08 AM John Strong ***@***.***> wrote:
Thanks for taking time to respond. Here's the traceback:
After the import
from matplotlib import pyplot as plt
I get
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-52-99ba79ecbbfb> in <module>
----> 1 from matplotlib import pyplot as plt
C:\Anaconda3\envs\py36-keras\lib\site-packages\matplotlib\pyplot.py in <module>
30 from cycler import cycler
31 import matplotlib
---> 32 import matplotlib.colorbar
33 import matplotlib.image
34 from matplotlib import rcsetup, style
C:\Anaconda3\envs\py36-keras\lib\site-packages\matplotlib\colorbar.py in <module>
26
27 import matplotlib as mpl
---> 28 import matplotlib.artist as martist
29 import matplotlib.cbook as cbook
30 import matplotlib.collections as collections
C:\Anaconda3\envs\py36-keras\lib\site-packages\matplotlib\artist.py in <module>
8
9 import matplotlib
---> 10 from . import cbook, docstring, rcParams
11 from .path import Path
12 from .transforms import (Bbox, IdentityTransform, Transform, TransformedBbox,
ImportError: cannot import name 'rcParams'
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1280 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AARy-A1XiuxSgpmx9OI0rQmyU6nb3GOqks5vJDxmgaJpZM4AKSQk>
.
|
How can I verify that it is valid? You can view the file here. |
@pluviosilla Can you do import logging
logging.basicConfig(level=logging.DEBUG)
import matplotlib.pyplot as plt Its just that your install is messed up somehow - running the debugging will help us see how. |
Nothing changes, unfortunately:
|
And changing the debugging level has no effect on the amount of spew. |
That means that you do not have a recent matplotlib installed in |
These problems occur in a newly created conda environment where I installed matplotlib in the usual way: Versions: python 3.6 and matplotlib-3.0.2-py36_1002. |
Does conda really install in You can also try: import logging
logging.basicConfig(level=logging.DEBUG)
import matplotlib
print('Version', matplotlib.__version__)
import matplotlib.pyplot as plt |
Here's what I get:
As for my conda installation info, here's what I get:
|
The fact you can't even print the I'd clean up your conda install - in particular, I don't think you want the |
I don't think the "Anaconda3" is the problem. Been using that for ages and never had this kind of problem before. I have a number of conda environments. Maybe too many. |
Actually, could you print out `matplotlib.__file__`?
…On Fri, Feb 1, 2019 at 1:59 PM John Strong ***@***.***> wrote:
I don't think the "Anaconda3" is the problem. Been using that for ages and
never had this kind of problem before.
I have a number of conda environments. Maybe too many.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1280 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AARy-JsVCMZap3TgvdK3iPBCwMUJwPLyks5vJI6tgaJpZM4AKSQk>
.
|
@pluviosilla If you are still having trouble, probably worth opening a new issue. But please make sure its not a conda problem first, which this really seems to be. We can't really debug install issues. |
I still have the same issue, is there any solution. I tried uninstalling and installing matplotlib but I still get the same error message: ImportError: cannot import name 'rcParams' from 'matplotlib' (unknown location) |
Have you tried |
I have this issue and I don't have anaconda at all |
I've tried this demo from your website:
http://matplotlib.org/api/widgets_api.html?highlight=matplotlib.widgets#matplotlib.widgets.RectangleSelector
But at the moment of runnig your program I've this error:
File "rec.py", line 1, in
from matplotlib.widgets import RectangleSelector
File "/usr/lib/python3.2/site-packages/matplotlib/init.py", line 105, in
import os, re, shutil, subprocess, sys, warnings
File "/usr/lib/python3.2/subprocess.py", line 378, in
import select
File "/home/simone/spz/select.py", line 1, in
from pylab import *
File "/usr/lib/python3.2/site-packages/pylab.py", line 1, in
from matplotlib.pylab import *
File "/usr/lib/python3.2/site-packages/matplotlib/pylab.py", line 222, in
from matplotlib import mpl # pulls in most modules
File "/usr/lib/python3.2/site-packages/matplotlib/mpl.py", line 1, in
from matplotlib import artist
File "/usr/lib/python3.2/site-packages/matplotlib/artist.py", line 6, in
from matplotlib import docstring, rcParams
ImportError: cannot import name rcParams
I'm using the GIT version with python 3 under ArchLinux.
But I've observed the same problem with matplotlb 1.1.1 on python 2
The text was updated successfully, but these errors were encountered: