matplotlib / basemap

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

install geos-3.3.3 configure error: on ubuntu20.04 #488

Closed kinglionsz closed 2 years ago

kinglionsz commented 4 years ago

With Python 2 having been end-of-life since the start of the year and Ubuntu 20.04 being a long-term support release, Ubuntu developers are working hard to ensure Python 2 isn't shipped as part of this next Ubuntu LTS release.

In fact, when I installed the package, I was already aware of a problem, not code, but it was actually the code problem.

When I installed geso package,I had to stop.because the print:

matplotlibBasemap\basemap-master\geos-3.3.3\configure:

`

am_cv_python_version=`$PYTHON -c "import sys; print(sys.version[:3])"`

am_cv_python_platform=`$PYTHON -c "import sys; print(sys.platform)"`

  am_cv_python_pythondir=`$PYTHON -c "from distutils import sysconfig; print(sysconfig.get_python_lib(0,0,prefix='$PYTHON_PREFIX'))" 2>/dev/null ||
     echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"`

`

You'll find that I've changed the code.Yes.

In fact, when I installed the package, I was already aware of a problem, not code, but it was actually the code problem.

Starting today, we'll have to consider upgrading the code.

Do you have any good ideas?

Thanks

kinglionsz commented 4 years ago

error: Swig: false Python bindings: false Ruby bindings: false PHP bindings: false

checking for python... /usr/bin/python checking for python version... File "", line 1 import sys; print sys.version[:3] ^ SyntaxError: invalid syntax

checking for python platform... File "", line 1 import sys; print sys.platform ^ SyntaxError: invalid syntax

checking for python script directory... ${prefix}/lib/python/site-packages checking for python extension module directory... ${exec_prefix}/lib/python/site-packages ./configure: line 13386: test: =: unary operator expected checking for Python include path... /usr/include/python3.8 checking for Python library path... configure: error: cannot find Python library path

solved: ./configure --prefix=$GEOS_DIR --enable-python

gedit ./configure find import sys change print ... > print(...)

then restart ./configure

ok now

geos3 3 configure_print

molinav commented 3 years ago

Hi @kinglionsz,

Thanks for the feedback. Actually the current GEOS version that is part of this repository is quite old. If you are a Ubuntu 20.04 user, the setup.py file should be able to compile _geoslib with the system GEOS library if it is installed (sudo apt-get install python3-dev libgeos-3.8.0 libgeos-dev). In this case you do not need to care about compiling GEOS or providing the GEOS_DIR environment variable.

In the following days I will be probably updating a bit the GEOS-related part of basemap, I would like to start using at least its version 3.5.2 since this one allows to compile GEOS quite straightforward with cmake under GNU/Linux and also Windows.

molinav commented 2 years ago

@kinglionsz I uploaded preliminary wheel files to PyPI with libgeos_c already bundled, we will have a stable release in PyPI soon so that end users do not need to be compiling GEOS themselves.