gpt4 book ai didi

python - 在 Linux 上使用 Python 模块编译 GEOS 3.6.2

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:35:35 25 4
gpt4 key购买 nike

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

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

配置命令失败:

...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 库存在于/usr/local/lib/python3.6/config-3.6m-x86_64-linux-gnu/libpython3.6m.a`

我用一个简单的 ./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' 而失败。

额外的 FIX 是添加一个符号链接(symbolic link)作为 ln -s libpython3.6m.1.0 libpython3.6.so在库目录中。

关于python - 在 Linux 上使用 Python 模块编译 GEOS 3.6.2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49561381/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com