Search code examples
pythonpandasmatplotlibimporterror

ImportError after importing matplotlib


please could any one help! Trying to import matplotlib I get this ImportError: *cannot import name 'artist' from 'matplotlib'*. I removed the package (*py -m pip uninstall matplotlib*) and reinstall it but I still get the same error. Thanks!


Solution

  • One of the common reasons why Python packages cannot be imported is because of its virtual environments. Basically when you install a package manager, it creates some root environment for you and you by default install all packages there. Now this issue may arise if you download a package into another VE, then in your code editor you should pick the one where it lies. I recommend you to check if your package is installed and pick that environment in the IDE, however from what I know it generates a different error message, something like the import couldn't be resolved. Did it help you?