-2

I'm trying to install offline the following dependencies : requests and Office365-REST-Python-Client in my production environnement.

I downloaded zipped packages using :

pip download - r requests.txt

I got the following .whl

enter image description here

When I try to run the install on the production server with the following command :

pip3 install -r /dumy_path/wheels/requirements.txt --no-index --find-links file:///dumy_path/wheels

I get the following error for the crypto package:

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))

Production environnement is Redhat 7.9 and dev environnement is Fedora Workstation 33 How can I fix this ? Thanks

isoman
  • 742
  • 2
  • 9
  • 34

1 Answers1

1

So this could be 1 or 2 things or a combination of the two.

If you notice Cryptography is architecture dependent, it's tagged with manylinux2014_x86_64 meaning it's built for CPython 3.6 with ABI3. This means it's a C/C++ module that was built specifically for newer Linux platforms using x86_64 architecture.

So first thing to check, are both machines the same arch? uname -m Second are both machines using the same Python version? python3 --version

The first giveaway is that your Dev machine is Fedora 33, but server is RHEL 7 and RHEL 7 is based on Fedora 19.

So your Dev and Prod server are very far off from being the same and therefore very unlikely the same Python3 version.

If you want to ensure better compatibility you should use CentOS 7 as your Dev and you will have probably Zero differences and therefore solve your issue.

RobertDeRose
  • 649
  • 8
  • 5