-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Can't import rcParams from colors.py
#16386
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
Comments
That is because What is happening is that:
Probably the simplest fix is to move the colors import into the function where it is used (to defer it until after import time), but I am not ever sure that will work as we need that function to define rcParams to begin with. Where do you want to import |
I was trying to fix I feel you have explained the circular imports to me before, thanks for doing so again. But it seems somewhat broken that we can't import any modules that use |
I think that might work, but would depend on exactly how and where we use it in the imported modules. You can't use |
One thing that may help is that we should never do (from within the codebase) |
I'll close this as there are a number of PRs that changed importing rcParams directly to getting it from |
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 ofcolors.py
, I get an error(FWIW, I don't want to do this, I really want to do
import matplotlib.scale as mscale
but it throws the same error insidescale.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.
The text was updated successfully, but these errors were encountered: