Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Can't import rcParams from colors.py #16386

Closed
@jklymak

Description

@jklymak

On master, clean conda install, with a pip -e install . to get the development version, if I add:

from matplotlib import rcParams to the top of colors.py, I get an error

Traceback (most recent call last):
  File "testImport.py", line 1, in <module>
    import matplotlib.pyplot as plt
  File "/Users/jklymak/matplotlib/lib/matplotlib/__init__.py", line 106, in <module>
    from . import cbook, rcsetup
  File "/Users/jklymak/matplotlib/lib/matplotlib/rcsetup.py", line 31, in <module>
    from matplotlib.colors import is_color_like
  File "/Users/jklymak/matplotlib/lib/matplotlib/colors.py", line 68, in <module>
    from matplotlib import rcParams
ImportError: cannot import name 'rcParams' from 'matplotlib' (/Users/jklymak/matplotlib/lib/matplotlib/__init__.py)

(FWIW, I don't want to do this, I really want to do import matplotlib.scale as mscale but it throws the same error inside scale.py, so the is the simplest reproducible error).

The other cases where folks have seen this (#1280, #12983, #13407, #15353) have seemed to be cases where there was a name clash. Bit this is a pretty clean install, so I don't think thats the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions