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
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.
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'
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>
.
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.
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>
.
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>
.
These problems occur in a newly created conda environment where I installed matplotlib in the usual way:
conda install matplotlib -n py36-keras
After experiencing all these difficulties I tried uninstalling and reinstalling as well as:
conda install matplotlib -c conda-forge -n py36-keras
Versions: python 3.6 and matplotlib-3.0.2-py36_1002.
The fact you can't even print the __version__ means your install is broken.
I'd clean up your conda install - in particular, I don't think you want the C:\Anaconda3 path in there, but I'm not an expert on how conda works on Windows machines.
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)
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)
Activity
efiring commented on Sep 19, 2012
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.
santhoshav15 commented on Dec 13, 2018
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
Any solution?
WeatherGod commented on Dec 13, 2018
santhoshav15 commented on Dec 14, 2018
@WeatherGod I have pip3(only for python 3), no pip installed. Python version 3.5.2 standard that comes along with standard Ubuntu 16.04
I had even opened a thread ImportError: cannot import name 'rcParams'
The issue got fixed obviously after i changed the name of dis.py
pluviosilla commented on Jan 31, 2019
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.
WeatherGod commented on Feb 1, 2019
pluviosilla commented on Feb 1, 2019
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'WeatherGod commented on Feb 1, 2019
pluviosilla commented on Feb 1, 2019
How can I verify that it is valid? You can view the file here.
jklymak commented on Feb 1, 2019
@pluviosilla Can you do
Its just that your install is messed up somehow - running the debugging will help us see how.
pluviosilla commented on Feb 1, 2019
Nothing changes, unfortunately:
--------------------------------------------------------------------------- ImportError Traceback (most recent call last) <ipython-input-53-ebf44ebd011b> in <module> 1 import logging 2 logging.basicConfig(level=logging.DEBUG) ----> 3 import matplotlib.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'pluviosilla commented on Feb 1, 2019
And changing the debugging level has no effect on the amount of spew.
jklymak commented on Feb 1, 2019
That means that you do not have a recent matplotlib installed in C:\Anaconda3\envs\py36-keras Try updating.
pluviosilla commented on Feb 1, 2019
These problems occur in a newly created conda environment where I installed matplotlib in the usual way:
conda install matplotlib -n py36-keras
After experiencing all these difficulties I tried uninstalling and reinstalling as well as:
conda install matplotlib -c conda-forge -n py36-keras
Versions: python 3.6 and matplotlib-3.0.2-py36_1002.
jklymak commented on Feb 1, 2019
Does conda really install in C:\Anaconda3 on Windows? What does conda info give you?
You can also try:
pluviosilla commented on Feb 1, 2019
Here's what I get:
--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-60-4ac91ebc2005> in <module> 2 logging.basicConfig(level=logging.DEBUG) 3 import matplotlib ----> 4 print('Version', matplotlib.__version__) 5 import matplotlib.pyplot as plt AttributeError: module 'matplotlib' has no attribute '__version__'As for my conda installation info, here's what I get:
C:\WINDOWS\system32>conda info active environment : None user config file : C:\Users\John\.condarc populated config files : C:\Users\John\.condarc conda version : 4.6.2 conda-build version : 3.4.1 python version : 3.6.4.final.0 base environment : C:\Anaconda3 (writable) channel URLs : https://conda.anaconda.org/conda-forge/win-64 https://conda.anaconda.org/conda-forge/noarch https://repo.anaconda.com/pkgs/main/win-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/free/win-64 https://repo.anaconda.com/pkgs/free/noarch https://repo.anaconda.com/pkgs/r/win-64 https://repo.anaconda.com/pkgs/r/noarch https://repo.anaconda.com/pkgs/msys2/win-64 https://repo.anaconda.com/pkgs/msys2/noarch package cache : C:\Anaconda3\pkgs C:\Users\John\.conda\pkgs C:\Users\John\AppData\Local\conda\conda\pkgs envs directories : C:\Anaconda3\envs C:\Users\John\.conda\envs C:\Users\John\AppData\Local\conda\conda\envs platform : win-64 user-agent : conda/4.6.2 requests/2.18.4 CPython/3.6.4 Windows/10 Windows/10.0.17134 administrator : True netrc file : None offline mode : Falsejklymak commented on Feb 1, 2019
The fact you can't even print the __version__ means your install is broken.
I'd clean up your conda install - in particular, I don't think you want the C:\Anaconda3 path in there, but I'm not an expert on how conda works on Windows machines.
pluviosilla commented on Feb 1, 2019
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.
WeatherGod commented on Feb 1, 2019
jklymak commented on Feb 2, 2019
@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.
MorganWeiss commented on Jan 27, 2020
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)
kvamsi7 commented on Jun 13, 2021
Have you tried conda install -f matplotlib
dentalfloss1 commented on Jun 16, 2023
I have this issue and I don't have anaconda at all