matplotlib / basemap

Plot on map projections (with coastlines and political boundaries) using matplotlib

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

need insights on importing mpl_toolkits.basemap and installation of basemap

sahanaRavinder opened this issue · comments

need insights on importing mpl_toolkits.basemap and installation of basemap

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

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

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

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