matplotlib / basemap

Plot on map projections (with coastlines and political boundaries) using matplotlib
MIT License
774 stars 392 forks source link

can not inport dedent (and also Basemap, cartopy) error; How do I solve #515

Closed Hometown11 closed 3 years ago

Hometown11 commented 3 years ago

I have an issue with importing either Basemep or cartopy in to my plots; I am on windows 10 and Python 3.9. I have tried what most comments suggest on how to resolve this including; import sys, pip install --user matplotlib==2.2.4, I have run several pip install of many suggestions on this platform in vain. I also get error of incompatible environments and sometimes the user does not have permission. Key errors are captured below. I am on How do I solve this?

ImportError: cannot import name 'dedent' from 'matplotlib.cbook' (C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\cbook__init__.py)

error when i install cartopy.

ImportError: cannot import name 'Basemap' from 'matplotlib' (C:\ProgramData\Anaconda3\lib\site-packages\matplotlib__init__.py)

ERROR: Failed building wheel for cartopy ERROR: Could not build wheels for cartopy which use PEP 517 and cannot be installed directly

WeatherGod commented 3 years ago

This seems more like a corrupted install environment than anything else. I suggest starting from a clean environment, and completely avoid basemap. Don't even try installing basemap unless you specifically know you need basemap to support legacy software. Also, use conda and the conda-forge repository instead of pip.

On Sat, May 8, 2021 at 11:13 AM Hometown11 @.***> wrote:

I have an issue with importing either Basemep or cartopy in to my plots; I am on windows 10 and Python 3.9. I have tried what most comments suggest on how to resolve this including; import sys, pip install --user matplotlib==2.2.4, I have run several pip install of many suggestions on this platform in vain. I also get error of incompatible environments and sometimes the user does not have permission. Key errors are captured below. I am on How do I solve this?

ImportError: cannot import name 'dedent' from 'matplotlib.cbook' (C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\cbookinit.py) error when i install cartopy.

ImportError: cannot import name 'Basemap' from 'matplotlib' (C:\ProgramData\Anaconda3\lib\site-packages\matplotlibinit.py)

ERROR: Failed building wheel for cartopy ERROR: Could not build wheels for cartopy which use PEP 517 and cannot be installed directly

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/matplotlib/basemap/issues/515, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACHF6CS5DL2NEKQGEVMG53TMVIH5ANCNFSM44NMKTWQ .

Hometown11 commented 3 years ago

This is now resolved. Thanks.