【问题标题】:Installing Error of Shapely and GDAL on pydroid在 pydroid 上安装 Shapely 和 GDAL 的错误
【发布时间】:2020-03-15 14:00:12
【问题描述】:

Pydroid 是一款适合初学者和其他人在 android 上运行 python 的好应用程序。我可以毫无问题地安装许多有用的库,但是我不明白为什么无法安装诸如GDALShapelyPyproj 之类的库。

安装错误:

ERROR: Command errored out with exit status 1:
command: /data/user/0/ru.iiec.pydroid3/files/arm-linux-androideabi/bin/python3.6 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/data/data/ru.iiec.pydroid3/cache/pip-install-1glqlnnp/shapely/setup.py'"'"'; __file__='"'"'/data/data/ru.iiec.pydroid3/cache/pip-install-1glqlnnp/shapely/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /data/data/ru.iiec.pydroid3/cache/pip-install-1glqlnnp/shapely/pip-egg-info
             cwd: /data/data/ru.iiec.pydroid3/cache/pip-install-1glqlnnp/shapely/
        Complete output (11 lines):
        Failed `CDLL(libgeos_c.so.1)`
        Failed `CDLL(libgeos_c.so)`
        Traceback (most recent call last):
          File "<string>", line 1, in <module>
          File "/data/data/ru.iiec.pydroid3/cache/pip-install-1glqlnnp/shapely/setup.py", line 80, in <module>
            from shapely._buildcfg import geos_version_string, geos_version, \
          File "/data/data/ru.iiec.pydroid3/cache/pip-install-1glqlnnp/shapely/shapely/_buildcfg.py", line 167, in <module>
            fallbacks=['libgeos_c.so.1', 'libgeos_c.so'])
          File "/data/data/ru.iiec.pydroid3/cache/pip-install-1glqlnnp/shapely/shapely/_buildcfg.py", line 161, in load_dll
            libname, fallbacks or []))
        OSError: Could not find library geos_c or load any of its variants ['libgeos_c.so.1', 'libgeos_c.so']
        ----------------------------------------
    ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
    /storage/emulated/0 $

任何帮助将不胜感激。我正在运行 Android Nougat 7.0 版和 Pydroid 3 (python3)。

【问题讨论】:

    标签: python-3.x pip libraries c-libraries pydroid


    【解决方案1】:

    您提到的三个 python 模块都依赖于 C 库,即它们不是纯 python,而是为较低级别的函数提供接口。具体来说,上面提到的三个 python 模块需要这些库:

    1. GDALGDAL 库的工具集
    2. Shapely,正如您的错误消息所暗示的,取决于 Geos
    3. pyprojproj 的接口

    因此,您需要为您的系统自行下载和编译这些库(或查找预编译的二进制文件,但这听起来不太适合您的设置)。只有这样你才能安装和使用相应的python模块。

    【讨论】:

    • 能否告诉我如何为我的 android 编译此类库,例如教程或 sthg。用英语或德语。我试图搜索并搜索在 pydroid 上安装此类库,但我没有找到它:(,谢谢你给我的信息
    猜你喜欢
    • 2018-09-24
    • 1970-01-01
    • 2021-05-09
    • 2017-07-23
    • 2020-05-25
    • 2018-03-01
    • 2012-08-21
    • 1970-01-01
    • 2020-02-28
    相关资源
    最近更新 更多