matplotlib / basemap

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

need insights on importing mpl_toolkits.basemap and installation of basemap #530

Closed sahanaRavinder closed 2 years ago

molinav commented 2 years ago

@sahanaRavinder Please provide a description of the problem, only this way we can try to help you.

sahanaRavinder commented 2 years ago

thank u for the response....below is command prompt response while i m trying to install basemap....kindly see and share your thoughts

Users\sahana.DESKTOP-VB0949B.000\AppData\Local\Programs\Python\Python310\Lib\site-packages\basemap-1.3.0\packages\basemap>python setup.py install C:\Users\sahana.DESKTOP-VB0949B.000\AppData\Local\Programs\Python\Python310\Lib\site-packages\basemap-1.3.0\packages\basemap\setup.py:52: RuntimeWarning: Cannot find GEOS library and/or headers in standard locations ('C:\Users\sahana.DESKTOP-VB0949B.000/local', 'C:\Users\sahana.DESKTOP-VB0949B.000', '/usr/local', '/usr', '/opt/local', '/opt', '/sw'). Please install the corresponding packages using your software management system or set the environment variable GEOS_DIR to point to the location where GEOS is installed (for example, if 'geos_c.h' is in '/usr/local/include' and 'libgeos_c' is in '/usr/local/lib', then you need to set GEOS_DIR to '/usr/local' warnings.warn(" ".join([ C:\Users\sahana.DESKTOP-VB0949B.000\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer. warnings.warn( running install C:\Users\sahana.DESKTOP-VB0949B.000\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( C:\Users\sahana.DESKTOP-VB0949B.000\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\command\easy_install.py:156: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools. warnings.warn( running bdist_egg running egg_info writing manifest file 'src\basemap.egg-info\SOURCES.txt' running install_lib running build_py running build_ext "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\sahana.DESKTOP-VB0949B.000\AppData\Local\Programs\Python\Python310\lib\site-packages\numpy\core\include -IC:\Users\sahana.DESKTOP-VB0949B.000\AppData\Local\Programs\Python\Python310\include -IC:\Users\sahana.DESKTOP-VB0949B.000\AppData\Local\Programs\Python\Python310\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" /Tcsrc_geoslib.c /Fobuild\temp.win-amd64-3.10\Release\src_geoslib.obj _geoslib.c C:\Users\sahana.DESKTOP-VB0949B.000\AppData\Local\Programs\Python\Python310\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\bin\HostX86\x64\cl.exe' failed with exit code 2

molinav commented 2 years ago

I see at least two problems here:

  1. When building from source, you need to build GEOS by yourself first. The log says that python cannot find where GEOS is installed, so either you have not compiled GEOS first or you did not define the environment variable GEOS_DIR. You can use the GeosLibrary class that we provide in utils to build GEOS from scratch. You need to go to the folder where utils is found and type (e.g. if you want to get GEOS installed in a folder called extern):

    set GEOS_DIR='extern'
    python -c "import utils; utils.GeosLibrary('3.5.1').build(installdir='extern')"
  2. MSVC++ is complaining because it cannot find "io.h". Do you have Windows 10 SDK installed in your computer? See: https://stackoverflow.com/questions/40018405/cannot-open-include-file-io-h-no-such-file-or-directory

I also see that MSVC++ is picking the cross-compiling tool (from host x86 to target x64). Is this correct for your case or should it be taking the native compiler for x64?

We still do not offer precompiled binary wheels for Python 3.10. If using an older Python version is not a problem for you (e.g. Python 3.9), you could install basemap simply by means of pip with:

python -m pip install basemap
sahanaRavinder commented 2 years ago

Thanks a ton for the reply

On Tue, Jan 4, 2022 at 3:13 PM Víctor Molina García < @.***> wrote:

I see at least two problems here:

  1. When building from source, you need to build GEOS by yourself first. The log says that python cannot find where GEOS is installed, so either you have not compiled GEOS first or you did not define the environment variable GEOS_DIR. You can use the GeosLibrary class that we provide in utils to build GEOS from scratch. You need to go to the folder where utils is found and type (e.g. if you want to get GEOS installed in a folder called extern):

set GEOS_DIR='extern' python -c "import utils; utils.GeosLibrary('3.5.1').build(installdir='extern')"

  1. MSVC++ is complaining because it cannot find "io.h". Do you have Windows 10 SDK installed in your computer? See:

    https://stackoverflow.com/questions/40018405/cannot-open-include-file-io-h-no-such-file-or-directory

I also see that MSVC++ is picking the cross-compiling tool (from host x86 to target x64). Is this correct for your case or should it be taking the native compiler for x64?

We still do not offer precompiled binary wheels for Python 3.10. If using an older Python version is not a problem for you (e.g. Python 3.9), you could install basemap simply by means of pip with:

python -m pip install basemap

— Reply to this email directly, view it on GitHub https://github.com/matplotlib/basemap/issues/530#issuecomment-1004659167, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWHA7M4ROCCTKZA7XFSJRWTUUK6KVANCNFSM5LFCOGRQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

molinav commented 2 years ago

Closing since I guess this is a duplicate of issue #531.

sahanaRavinder commented 2 years ago

Okay..btw tqsm for the Guidance

On Sat, 22 Jan 2022, 05:45 Víctor Molina García, @.***> wrote:

Closed #530 https://github.com/matplotlib/basemap/issues/530.

— Reply to this email directly, view it on GitHub https://github.com/matplotlib/basemap/issues/530#event-5935514668, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWHA7M6PA7S3C3VJKDSQEJ3UXHZKXANCNFSM5LFCOGRQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>