matplotlib / basemap

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

Failure to install Basemap on linux system #445

Closed YuHuang3019 closed 2 years ago

YuHuang3019 commented 5 years ago

Hi all,

I am trying to install Basemap to python3.6.3 on a linux system(stampede2). My account is just a user account and I am not permitted to use command sudo. I created a virtual environment so that I could make modifications. I also set GEOS_DIR, PROJ_DIR to my /home/GEOS and /home/PROJ because the default directory was not permitted to modify.

I mainly followed two websites: https://matplotlib.org/basemap/users/installing.html https://www.reddit.com/r/learnpython/comments/2b4p71/trouble_installing_basemap/ During the installation, there are warnings like below warning: no files found matching 'README' warning: no files found matching 'LICENSE_proj4' warning: no files found matching 'LICENSE_pyshp' warning: no files found matching 'lib/mpl_toolkits/basemap/pyproj.py' warning: no files found matching 'lib/mpl_toolkits/basemap/shapefile.py' writing manifest file 'lib/basemap.egg-info/SOURCES.txt' warning: sdist: standard file not found: should have one of README, README.rst, README.txt

When trying to use Basemap, I always have the problem of missing module _geoslib even though it seems that the basemap1.2.0 is installed. I tried to locate the path of the module and import with path clarified but I cannot find path too. I guess the missing of a few files caused this problem to occur but I have no idea how to fix it.

I am wondering whether you can help me to add the missing files. Or can anyone here give me a complete instruction about how to install Basemap correctly on a linux system?

Thanks!

Mayson12381 commented 5 years ago

same issue

GrandH2O commented 5 years ago

same to me, can you help me? @YuHuang3019

barronh commented 4 years ago

FYI - I get the same error using python setup.py install, but it works if I use pip install .

pesekon2 commented 4 years ago

FYI - I get the same error using python setup.py install, but it works if I use pip install .

The same worked for me. On Debian 10 with Python 3.7, it worked with normal python3 setup.py install, on CentOS 8 with Python 3.8 (otherwise the same versions of matplotlib, etc.), it worked only when installing using python3.8 -m pip install .

Roland-Pfeiffer commented 3 years ago

I have the same issue. Sorry if this is a stupid question, but what do you mean with "if I use pip install", @barronh ? Do you mean running pip install setup.py Thank you!

molinav commented 3 years ago

Hi @KaterFindus! It means that you have to run pip install . (with the dot at the end) from the folder in which the setup.py file resides.

Roland-Pfeiffer commented 3 years ago

Wow, thank you so much for the quick response, @molinav ! It works now, you're a life saver! :)

molinav commented 2 years ago

Precompiled wheels are available in PyPI since release 1.3.0. This means that you can now install directly using pip without the need of building the library yourself:

python -m pip install basemap

If you need the high-resolution data files, you have to install basemap-data-hires in addition:

python -m pip install basemap-data-hires

Hope this helps.