1

matplotlib has completely broken my python env.

When i run: import matplotlib as plt I received: FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\SamCurtis.AzureAD\AppData\Roaming\Python\Python38\site-packages\matplotlib.libs\.load-order-matplotlib-3.7.1'

I receive the same error if i try to pip install OR pip uninstall matplotlib Infact all my pip functionality is broken (i cannot pip freeze, uninstall / install) anything.

S_C
  • 37
  • 8

2 Answers2

0

Go to folder 'site-packages' in the path mentioned in this error and rename the files that start with '~atplotlib' to 'matplotlib'. It worked for me.

It threw another error in the process where it couldn't find module 'matplotlib.artist'. Resolution of which is on below link: https://stackoverflow.com/a/66688826/21626387

0

I bumped into a similar problem just now after attempting to downgrade back to my old matplotlib version from 3.7.1. pip was throwing up this matplotlib.libs error even when I wasn't trying to do anything involving matplotlib.

The solution was to delete the matplotlib and mpl_toolkits directories from site-packages. Then I was able to reinstall my old matplotlib version and use pip as usual.

user3419537
  • 4,740
  • 2
  • 24
  • 42