matplotlib / basemap

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

installation of basemap #531

Closed sahanaRavinder closed 2 years ago

sahanaRavinder commented 2 years ago

i have downloaded the basemap package from github,when i m trying to run the setup.py code from the 1st folder named as basemap,i m getting the below error,but the other two folders named basemap_data and basemap_data_hires setup.py programs got successfully installed

Microsoft Windows [Version 10.0.19043.1415] (c) Microsoft Corporation. All rights reserved.

C:\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\AppData\Local\Programs\Python\Python310\Lib\site-packages\geos__init__.py'). 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\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\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\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /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\lib\site-packages\numpy\core\include\numpy\npy_1_7_deprecated_api.h(14) : Warning Msg: Using deprecated NumPy API, disable it with #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION src_geoslib.c(680): fatal error C1083: Cannot open include file: 'geos_c.h': No such file or directory error: command 'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\bin\HostX86\x64\cl.exe' failed with exit code 2

C:\Users\sahana.DESKTOP-VB0949B.000\AppData\Local\Programs\Python\Python310\Lib\site-packages\basemap-1.3.0\packages\basemap>

please mention where the basemap-1.3.0 folder and geos folder should be placed.i., wether in the python folder or in the lib /sitepackages also do mention how to set the path of the GEOS i have already installed visual studio build compiler,oges and cmake

molinav commented 2 years ago

Hi @sahanaRavinder,

From your logs, it is clear that the problem with building basemap from source is due to GEOS not being found. Did you follow the steps from the README file? In particular, this (assuming you use the command prompt and you want to build GEOS e.g. in a temporary folder called extern):

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

After that, you need to build the basemap wheel using bdist_wheel so that the GEOS dll gets bundled:

python setup.py bdist_wheel

After that, you will have built the wheel package from source and it will be available in the dist folder, and you can install the wheel file with pip install.

One last point: it does not matter where you download the basemap source code or the GEOS source code. The source code must be downloaded somewhere so that you can build the wheel package from source. What lives later in site-packages is the content of this wheel package after installing it with pip install.

molinav commented 2 years ago

@sahanaRavinder From what I saw in https://github.com/libgeos/geos/issues/536, be sure of being located at packages\basemap when doing this:

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

If you run this from packages\basemap\utils, it will not obviously work. I would also recommend you to build the source code somewhere outside the Python system folders.

sahanaRavinder commented 2 years ago

Thanks, I'll check it out.

On Thu, 13 Jan 2022, 18:00 Víctor Molina García, @.***> wrote:

@sahanaRavinder https://github.com/sahanaRavinder From what I saw in libgeos/geos#536 https://github.com/libgeos/geos/issues/536, be sure of being located at packages\basemap when doing this:

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

If you run this from packages\basemap\utils, it will not obviously work. I would also recommend you to build the source code somewhere outside the Python system folders.

— Reply to this email directly, view it on GitHub https://github.com/matplotlib/basemap/issues/531#issuecomment-1012093656, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWHA7MZVYBOZWAQW7MT64BTUV3AVTANCNFSM5LVTWYZA . 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

@sahanaRavinder I recently released basemap version 1.3.1 which ensures support for Python 3.10, and I uploaded precompiled wheels for Windows (and GNU/Linux) to PyPI. This means that now you can install basemap on your Windows system by simply typing:

python -m pip install basemap

Could you check if this works for you? This way you can install basemap without having to compile from source.

sahanaRavinder commented 2 years ago

Thanks, I'll check it out.

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

@sahanaRavinder https://github.com/sahanaRavinder I recently released basemap version 1.3.1 which ensures support for Python 3.10, and I uploaded precompiled wheels for Windows (and GNU/Linux) to PyPI. This means that now you can install basemap on your Windows system by simply typing:

python -m pip install basemap

Could you check if this works for you? This way you can install basemap without having to compile from source.

— Reply to this email directly, view it on GitHub https://github.com/matplotlib/basemap/issues/531#issuecomment-1019211234, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWHA7M4WBPLUHZNYWSL4MOTUXKK7NANCNFSM5LVTWYZA . 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

@sahanaRavinder Did you have time to try it out and see if you can install basemap 1.3.1 with pip?

sahanaRavinder commented 2 years ago

Sorry ,I didn't try as I was occupied with other things...I will try it ASAP and let you know

On Fri, 28 Jan 2022, 21:01 Víctor Molina García, @.***> wrote:

@sahanaRavinder https://github.com/sahanaRavinder Did you have time to try it out and see if you can install basemap 1.3.1 with pip?

— Reply to this email directly, view it on GitHub https://github.com/matplotlib/basemap/issues/531#issuecomment-1024330963, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWHA7MZFE4YXDXFDIAEVJO3UYKZEZANCNFSM5LVTWYZA . 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

I am closing this issue due to lack of feedback. Since we now have wheel files for Windows and Python 3.10, the installation should be straightforward. Feel free to reopen the issue if the problem persists.