Skip to content

ImportError: cannot import name 'rcParams' #13407

Closed

Description

@RohanJ24

Traceback (most recent call last):
File "/home/ewebcore/Desktop/numpy.py", line 18, in
from matplotlib import pyplot as plt
File "/usr/lib/python3/dist-packages/matplotlib/init.py", line 123, in
from . import cbook
File "/usr/lib/python3/dist-packages/matplotlib/cbook/init.py", line 36, in
import numpy as np
File "/home/ewebcore/Desktop/numpy.py", line 18, in
from matplotlib import pyplot as plt
File "/usr/lib/python3/dist-packages/matplotlib/pyplot.py", line 32, in
import matplotlib.colorbar
File "/usr/lib/python3/dist-packages/matplotlib/colorbar.py", line 32, in
import matplotlib.artist as martist
File "/usr/lib/python3/dist-packages/matplotlib/artist.py", line 15, in
from . import cbook, docstring, rcParams
ImportError: cannot import name 'rcParams'

Give me solution for above error

Activity

  1. ImportanceOfBeingErnest commented on Feb 11, 2019

    @ImportanceOfBeingErnest
    Member

    Please don't name any script you want to run by the same name as a package you have installed. That is, don't call your script numpy.py.

  2. RohanJ24 commented on Feb 11, 2019

    @RohanJ24
    Author

    Please don't name any script you want to run by the same name as a package you have installed. That is, don't call your script numpy.py.

    Still I got same error:

    Traceback (most recent call last):
    File "/home/ewebcore/Desktop/testing.py", line 18, in
    from matplotlib import pyplot as plt
    File "/usr/lib/python3/dist-packages/matplotlib/init.py", line 123, in
    from . import cbook
    File "/usr/lib/python3/dist-packages/matplotlib/cbook/init.py", line 36, in
    import numpy as np
    File "/home/ewebcore/Desktop/numpy.py", line 18, in
    from matplotlib import pyplot as plt
    File "/usr/lib/python3/dist-packages/matplotlib/pyplot.py", line 32, in
    import matplotlib.colorbar
    File "/usr/lib/python3/dist-packages/matplotlib/colorbar.py", line 32, in
    import matplotlib.artist as martist
    File "/usr/lib/python3/dist-packages/matplotlib/artist.py", line 15, in
    from . import cbook, docstring, rcParams
    ImportError: cannot import name 'rcParams'

  3. ImportanceOfBeingErnest commented on Feb 11, 2019

    @ImportanceOfBeingErnest
    Member

    Yes you have added a different script now, but the initial numpy.py is still present. Delete that file.

  4. RohanJ24 commented on Feb 11, 2019

    @RohanJ24
    Author

    Yes you have added a different script now, but the initial numpy.py is still present. Delete that file.

    It works... Thanx !! : )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions