python - Google App Engine rtree Python 模块安装
问题描述
Google App Engine,不包括 libspatialindex,因此我无法安装 rtree python 模块,即使它在 requirements.txt 中,
它在部署应用程序时出现以下错误。(应用程序在本地运行良好。)如何在 python 标准谷歌应用程序引擎环境中安装特定的库?或者我如何要求他们这样做?
Collecting rtree
Downloading Rtree-0.9.4.tar.gz (62 kB)
ERROR: Command errored out with exit status 1:
command: /opt/python3.8/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-hl9513g_/rtree/setup.py'"'"'; __file__='"'"'/tmp/pip-install-hl9513g_/rtree/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 /tmp/pip-pip-egg-info-0tyv4fij
cwd: /tmp/pip-install-hl9513g_/rtree/
Complete output (15 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-hl9513g_/rtree/setup.py", line 3, in <module>
import rtree
File "/tmp/pip-install-hl9513g_/rtree/rtree/__init__.py", line 1, in <module>
from .index import Rtree
File "/tmp/pip-install-hl9513g_/rtree/rtree/index.py", line 6, in <module>
from . import core
File "/tmp/pip-install-hl9513g_/rtree/rtree/core.py", line 143, in <module>
rt.Error_GetLastErrorNum.restype = ctypes.c_int
File "/opt/python3.8/lib/python3.8/ctypes/__init__.py", line 386, in __getattr__
func = self.__getitem__(name)
File "/opt/python3.8/lib/python3.8/ctypes/__init__.py", line 391, in __getitem__
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: /opt/python3.8/bin/python3: undefined symbol: Error_GetLastErrorNum
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
解决方案
您将需要使用具有自定义运行时的灵活环境来利用标准环境中未预安装的软件包。
要安装 libspatialindex,请将其添加到 Dockerfile:
sudo apt-get update -y
sudo apt-get install -y libspatialindex-dev
推荐阅读
- sql - 为什么这个 Postgis 距离查询这么慢?Postgres 的查询估计器减少了 10000 倍?
- javascript - JavaScript 对象数组 - 基于嵌套对象从数组中删除重复对象
- java - 使用 JNDI 和 DataSource 的简单应用程序,没有服务器、ServiceUnavailableException、ConnectException
- .net - 在 Azure App Services 应用程序中向 localhost 发出请求
- javascript - 数以千计的引导开关:强制回流可能是性能瓶颈
- java - 从 Firebase 实时数据库获取当前用户信息
- windows - 尝试构建 docker 映像时,我得到“”gcc“:$PATH 中找不到可执行文件”
- unicode - SCSS 处理器 Unicode 输出不正确
- r - 如何增加 Rstudio 中的内存限制?
- javascript - 在正文标记末尾呈现阻止 Javascript - 内联与外部脚本