我正在尝试使用以下 Dockerfile 构建映像:
FROM public.ecr.aws/lambda/python:3.8
COPY app.py requirements.txt __init__.py ./
ADD models models
Add utils utils
RUN python3.8 -m pip install -r requirements.txt -t .
# Command can be overwritten by providing a different command in the template directly.
CMD ["app.lambda_handler"]
要求如下:
-f https://download.pytorch.org/whl/torch_stable.html
torch==1.8.0+cpu
appnope==0.1.0
backcall==0.2.0
certifi==2020.12.5
chardet==4.0.0
colorama==0.4.3
cycler==0.10.0
decorator==4.4.2
docutils==0.15.2
dotmap==1.3.23
idna==2.10
ipython==7.18.1
ipython-genutils==0.2.0
jedi==0.18.0
jmespath==0.10.0
jupyter-client==6.1.7
jupyter-core==4.6.3
kiwisolver==1.3.1
matplotlib==3.4.2
numpy==1.20.3
opencv-python==4.5.2.52
pandas==1.2.4
parso==0.8.0
pexpect==4.8.0
pickleshare==0.7.5
Pillow==8.2.0
pip==21.1.2
prompt-toolkit==3.0.8
ptyprocess==0.6.0
pyasn1==0.4.8
Pygments==2.7.1
pyparsing==2.4.7
python-dateutil==2.8.1
pytz==2021.1
pyzmq==19.0.2
requests==2.25.1
rsa==4.5
scipy==1.6.3
seaborn==0.11.1
setuptools==57.0.0
six==1.16.0
smart-open==5.1.0
tornado==6.0.4
tqdm==4.61.0
traitlets==5.0.5
typing-extensions==3.10.0.0
urllib3==1.26.4
wcwidth==0.2.5
wheel==0.36.2
当我尝试在本地调用时,这会导致标题中提到的错误:
Unable to import module 'app': libGL.so.1: cannot open shared object file: No such file or directory
例如,我在 this 线程中找到了有关此问题的帮助,但我找到的所有内容都对应于 linux。 Mac 上有没有针对这个问题的解决方案?
非常感谢!
答案 0 :(得分:0)
解决我的问题的方法是改用 opencv-python-headless
headless。