我正在尝试离线安装以下依赖项:requests and Office365-REST-Python-Client
在我的生产环境中。
我使用 :
下载了压缩包pip download - r requests.txt
我得到了以下 .whl
当我尝试使用以下命令在生产服务器上运行安装时:
pip3 install -r /dumy_path/wheels/requirements.txt --no-index --find-links file:///dumy_path/wheels
我收到加密包的以下错误:
Collecting Office365-REST-Python-Client==2.3.2 (from -r /dumy_path/wheels/requirements.txt (line 1))
Collecting requests (from -r /dumy_path/wheels/requirements.txt (line 2))
Collecting msal (from Office365-REST-Python-Client==2.3.2->-r /dumy_path/wheels/requirements.txt (line 1))
Collecting idna<3,>=2.5 (from requests->-r /dumy_path/wheels/requirements.txt (line 2))
Collecting urllib3<1.27,>=1.21.1 (from requests->-r /dumy_path/wheels/requirements.txt (line 2))
Collecting certifi>=2017.4.17 (from requests->-r /dumy_path/wheels/requirements.txt (line 2))
Collecting chardet<5,>=3.0.2 (from requests->-r /dumy_path/wheels/requirements.txt (line 2))
Collecting PyJWT[crypto]<3,>=1.0.0 (from msal->Office365-REST-Python-Client==2.3.2->-r /dumy_path/wheels/requirements.txt (line 1))
Collecting cryptography<4,>=0.6 (from msal->Office365-REST-Python-Client==2.3.2->-r /dumy_path/wheels/requirements.txt (line 1))
Could not find a version that satisfies the requirement cryptography<4,>=0.6 (from msal->Office365-REST-Python-Client==2.3.2->-r /dumy_path/wheels/requirements.txt (line 1)) (from versions: )
No matching distribution found for cryptography<4,>=0.6 (from msal->Office365-REST-Python-Client==2.3.2->-r /dumy_path/wheels/requirements.txt (line 1))
生产环境为 Redhat 7.9,开发环境为 Fedora Workstation 33 我怎样才能解决这个问题 ? 谢谢
答案 0 :(得分:1)
所以这可能是 1 或 2 件事或两者的组合。
如果您注意到密码学依赖于体系结构,它会被标记为 manylinux2014_x86_64
,这意味着它是为带有 ABI3 的 CPython 3.6 构建的。这意味着它是一个 C/C++ 模块,专为使用 x86_64 架构的较新 Linux 平台构建。
所以首先要检查,两台机器是同一个拱门吗? uname -m
其次,两台机器都使用相同的 Python 版本吗? python3 --version
第一个赠品是您的开发机器是 Fedora 33,但服务器是 RHEL 7,而 RHEL 7 基于 Fedora 19。
因此,您的 Dev 和 Prod 服务器远非相同,因此 Python3 版本不太可能相同。
如果你想确保更好的兼容性,你应该使用 CentOS 7 作为你的开发者,你可能会有零差异,从而解决你的问题。