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 (将#修改为@)