Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

1.3K
Views
ImportError: cannot import name '_path' matplotlib

When importing matplotlib by import matplotlib.pyplot as plt I'm getting the following error:

Traceback (most recent call last):   File "mode.py", line 1, in <module>
    import matplotlib.pyplot as plt   File "C:\Users\yuhan\AppData\Roaming\Python\Python36\site-packages\matplotlib\pyplot.py", line 32, in <module>
    import matplotlib.colorbar   File "C:\Users\yuhan\AppData\Roaming\Python\Python36\site-packages\matplotlib\colorbar.py", line 32, in <module>
    import matplotlib.artist as martist   File "C:\Users\yuhan\AppData\Roaming\Python\Python36\site-packages\matplotlib\artist.py", line 16, in <module>
    from .path import Path   File "C:\Users\yuhan\AppData\Roaming\Python\Python36\site-packages\matplotlib\path.py", line 25, in <module>
    from . import _path, rcParams ImportError: cannot import name '_path'

I tried reinstalling the whole matplotlib library, tried re-installing Python 3.6 etc. I really do not know what is wrong and since I don't have a backup.

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

py -m pip uninstall matplotlib

then:

py -m pip install matplotlib

worked for me for that error as well.

Then I had a problem of kiwisolver not being found, and did the same uninstall, install for kiwisolver and now: import matplotlib.pyplot as plt works.

over 4 years ago · Santiago Trujillo Report

0

This problem can pop up when you copy libraries from place to place (at least that's what happend with me :P)

Make sure that in .../Python37/Lib/site-packages there is a file named: matplotlib-3.0.2-py3.7-nspkg.pth with the correct version of Python and matplotlib

(in this example I am using python 3.7.1 and matplotlib 3.0.2)

If that's not the case, reinstall matplotlib like other users suggested. Make sure also that you are targeting the correct directory (sometimes I've seen that the problem might be the wrong version of pip)

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!