【发布时间】:2021-04-02 15:37:03
【问题描述】:
我正在尝试在使用 pymatting_aot.aot 的 Google App Engine 上运行 Python 3.8 脚本
在我的本地 Ubuntu 机器上运行此脚本时,它可以正常运行,但当我尝试在 GAE 上运行它时,出现以下错误:
Traceback (most recent call last):
File "/layers/google.python.pip/pip/lib/python3.8/site-packages/pymatting_aot/cc.py", line 21, in <module>
import pymatting_aot.aot
ModuleNotFoundError: No module named 'pymatting_aot.aot'
此 github 链接:https://github.com/danielgatis/rembg/issues/35,表明我需要安装 python3-dev 以通过 apt-get install -y python3-dev 解决问题
我在我的 GAE 控制台上尝试了sudo apt-get install -y python3-dev,我得到了:
machine is ephemeral and no system-wide change will persist beyond session end.
To suppress this warning, create an empty ~/.cloudshell/no-apt-get-warning file.
The command will automatically proceed in 5 seconds or on any key.
Visit https://cloud.google.com/shell/help for more information.
********************************************************************************
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-dev is already the newest version (3.7.3-1).
0 upgraded, 0 newly installed, 0 to remove and 37 not upgraded.
requirements.txt
-f https://download.pytorch.org/whl/torch_stable.html
numpy==1.19.4
torch==1.7.0+cpu
torchvision==0.8.1+cpu
pymatting==1.1.1
scikit-image==0.17.2
waitress==1.4.4
scipy==1.5.4
hsh==1.1.0
flask==1.1.2
filetype==1.0.7
matplotlib==3.1.1
tqdm==4.51.0
requests==2.25.0
fastapi==0.62.0
Pillow==8.0.1
skimage==0.0
uvicorn==0.11.6
gunicorn==20.0.4
python-multipart==0.0.5
问题依然存在, 知道如何使它工作吗?
【问题讨论】:
-
能否也提供 requirements.txt ?
-
@Jaroslav 添加了需求文件。
标签: python python-3.x google-app-engine google-cloud-platform