微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Python pex pex.environment.ResolveError

如何解决Python pex pex.environment.ResolveError

我试图将我的应用程序捆绑到 pex 文件中以进行部署。使用以下命令进行捆绑;

pex . -v --disable-cache -r requirements.txt -o app.pex

在本地运行 pex 对我来说很好

./app.pex -m app.main  # this works fine on my shell

但是当我尝试在没有预安装软件包(或尝试创建 docker 映像)的情况下在 pex 中运行 new virtual env 时,它会抛出 following error;

堆栈跟踪:

#13 3.214 Traceback (most recent call last):
#13 3.214   File "/app.pex/.bootstrap/pex/pex.py",line 483,in execute
#13 3.214   File "/app.pex/.bootstrap/pex/pex.py",line 139,in activate
#13 3.214   File "/app.pex/.bootstrap/pex/pex.py",line 126,in _activate
#13 3.214   File "/app.pex/.bootstrap/pex/environment.py",line 428,in activate
#13 3.214   File "/app.pex/.bootstrap/pex/environment.py",line 784,line 608,in resolve
#13 3.214   File "/app.pex/.bootstrap/pex/environment.py",line 629,in resolve_dists
#13 3.214   File "/app.pex/.bootstrap/pex/environment.py",line 573,in _root_requirements_iter
#13 3.214 pex.environment.ResolveError: A distribution for pyyaml Could not be resolved in this environment.Found 1 distribution for pyyaml that do not apply:
#13 3.214 1.) The wheel tags for PyYAML 5.4.1 are cp38-cp38-macosx_10_9_x86_64 which do not match the supported tags of distributionTarget(interpreter=pythoninterpreter('/usr/local/bin/python3.8',PythonIdentity('/usr/local/bin/python3.8','cp38','manylinux_2_28_x86_64',(3,8,5)))):

在我的 requirements.txt 中,我添加了对 'PyYAML==5.4.1' 的需求。似乎在分发目标中找不到轮标记 'cp38-cp38-macosx_10_9_x86_64'。不确定这里发生了什么。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。