matplotlib / basemap

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

Geoslib Import #587

Closed SoundsSerious closed 1 year ago

SoundsSerious commented 1 year ago

Hi,

Thanks for making this awesome library! Amazing for geospacial analysis.

I am rerunning some old code and encountering this error on both my linux machine and osx

  File "/mnt/c/Users/Sup/Ottermatics Dropbox/Projects/Neptunya/analysis/neptunya/neptunya/ocean_energy/locations.py", line 1063, in min_distance_to_land
    from mpl_toolkits.basemap import maskoceans

  File "/home/olly/miniconda3/envs/nept/lib/python3.10/site-packages/mpl_toolkits/basemap/__init__.py", line 53, in <module>
    import _geoslib

ImportError: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /home/olly/miniconda3/envs/nept/lib/python3.10/site-packages/../.././libgeos.so.3.11.2)
molinav commented 1 year ago

Hi, @SoundsSerious! What is your GNU/Linux distribution? From the traceback, I would expect that the conda packages are compiled against a too new libc.so.6 with symbols that your system does not have.

SoundsSerious commented 1 year ago

Yes that is what I am thinking. I am running Ubuntu20.04 on a WSL VM with python 3.10.

I have this working on my python3.9.12 OSX 12.3.1 and I left my conda environment downgrading to 3.9.12 on my WSL machine so hopefully I can confirm that makes a difference.

SoundsSerious commented 1 year ago

Upon digging into this a bit more I am able to import various basemap components from python as follows.

from mpl_toolkits.basemap import maskoceans
import mpl_toolkits.basemap
import _geoslib

However, when i try to run run a console script originating from the same python version I obtain the GLBCXX error and have verified its the same python executable.

I have followed the instruction here to install g++-11 and this error has been solved https://askubuntu.com/questions/1393285/how-to-install-glibcxx-3-4-29-on-ubuntu-20-04