Closed thdb-theo closed 2 years ago
It seems that tp_print
was removed in CPython 3.9 (see https://bugs.python.org/issue39361), so this error is probably occurring in the conversion of _geoslib.pyx
to _geoslib.c
.
Are you using the _geoslib.c
file from the repo? It might work if you remove the C file to force the generation of this file again by Cython. This _geoslib.c
file in the repo is probably super-old and ideally it should be deleted and add Cython as build dependency.
Thanks, that made me able to install, but led to another (possibly related) issue. When importing Basemap i get this error:
>>> from mpl_toolkits.basemap import Basemap
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/theodor/.local/lib/python3.9/site-packages/basemap-1.2.2+dev-py3.9-linux-x86_64.egg/mpl_toolkits/basemap/__init__.py", line 53, in <module>
import _geoslib
ImportError: libgeos-3.9.1.so: cannot open shared object file: No such file or directory
>>>
I have libgeos-dev 3.9.0-1installed
That looks strange to me, in the original message the output says:
GEOS lib (version 3.9.0) found in /usr
so I would expect basemap
to request libgeos-3.9.0.so
, which is available in Ubuntu 21.04 under /usr/lib/x86_64-linux-gnu/libgeos-3.9.0.so
when you install libgeos-3.9.0
(this package gets installed automatically with libgeos-dev
). Do you have several GEOS versions installed?
Thank for your help! I fixed it by removing 3.9.1 and installing 3.9.0.
Just to add here. The following worked for me without having to altered the version of Python.
sudo apt -y install libgeos-dev pip3 install git+https://github.com/matplotlib/basemap/
@thdb-theo @GeoFelpave I just uploaded preliminary wheel binaries of the future basemap
version 1.3.0 (with bundled libgeos_c
). In case you are still interested you can try out with (for Python 2.7 and 3.5 to 3.9):
python -m pip install "basemap-data == 1.3.0b1" "basemap == 1.3.0b1"
I have succesfully install geos, but running
sudo python3 setup.py install
fails with the following error:. . . .
A bunch of compiler notes and warnings. Then the error:
Installing using pip results in the same error.