尝试在已编译python 3.6.4的linux系统上安装geos-3.6.2。
我正在尝试使用以下命令制作包:

export PYTHON=/usr/local/bin/python3 && make && sudo make install

configure命令失败:
...much snipped...
checking for swig... /usr/bin/swig
checking for SWIG version... 3.0.8
configure: SWIG executable is '/usr/bin/swig'
configure: SWIG library directory is '/usr/share/swig3.0'
checking for python version... 3.6
checking for python platform... linux
checking for python script directory... ${prefix}/lib/python3.6/site-packages
checking for python extension module directory... ${exec_prefix}/lib/python3.6/site-packages
checking for Python include path... /usr/local/include/python3.6m
checking for Python library path...
configure: error: cannot find Python library path

我已经确认了Python库存在于/Ur/Prase/Lyb/Python 3.6/CONTIO-3.6M-SX66Y64-LIUX-GNU/LIPpython 3.6m。
我用一个简单的./configure --prefix=/usr/local && make && sudo make install编译了python
系统人员:
~/Downloads/geos-3.6.2$ uname -a
Linux Sleipnir 4.4.0-116-generic #140-Ubuntu SMP Mon Feb 12 21:23:04 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
~/Downloads/geos-3.6.2$ which python3
/usr/local/bin/python3
~/Downloads/geos-3.6.2$ python3 -V
Python 3.6.4
~$ cat /etc/*release*
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.4 LTS"
NAME="Ubuntu"
VERSION="16.04.4 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.4 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial

最佳答案

由于knud的上述评论,geos得以正确编译。
python现在配置为./configure --prefix=/usr/local --enable-shared,后面跟着sudo ldconfig -v /usr/local/lib
在执行这些操作之后,geos使用export PYTHON=/usr/local/bin/python3 && ./configure --prefix=/usr/local --enable-python && make && sudo make install
更新:尝试在另一个系统上构建geos时,我再次遇到此问题。这次的解决方案略有不同。python编译构建库,文件名为libpython3.6m.so.1.0。GEOS配置正在寻找libpython$PYTHON_VERSION.*的模式。如果python版本被确定为3.6,系统将返回该版本,则生成将由于添加了“m”而失败。
另一个解决方案是在库目录中添加符号链接ln -s libpython3.6m.1.0 libpython3.6.so

09-29 22:48