Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to install cryptography wheels for Python 3.6 #1150

Closed
asavaritayal opened this issue Mar 25, 2019 · 8 comments
Closed

Failure to install cryptography wheels for Python 3.6 #1150

asavaritayal opened this issue Mar 25, 2019 · 8 comments
Assignees

Comments

@asavaritayal
Copy link
Contributor

Since the Azure SDK takes a dependency on Cryptography which is a native package, publishing a Python Function App fails asking the user to publish using --build-native-deps.

This shouldn't be the case since Cryptography does provide version 3.6 compatible wheels, see here - pyca/cryptography#4382

/cc @maiqbal11 @elprans

@ankitkumarr
Copy link
Contributor

@asavaritayal, I looked into this. Cryptography provides whl for python 34 abi3. Looks like we do something similar to pip download --platform manylinux1_x86_64 --python-version 36 --abi cp36m. There's two issues here-

  1. pip download seems to specifically look for 36 version file even though the 34 file seems to be supported for 3.4+.
  2. I don't know much about Python abis. According to https://github.com/pypa/pip/issues/6070`, abi3 is compatible cp36m, but pip does not know so.

We can get around 2 by doing pip download twice with --abi abi3 and --abi cp<version>m. But, I am not sure if we can do anything about 1. Given that we need to specify the python version and I don't think there's a way of knowing in advance which version file (34 here) we need to download.

@asavaritayal
Copy link
Contributor Author

Adding @zooba and @1st1 to see if they have a recommendation on this one.

@zooba
Copy link
Member

zooba commented Mar 27, 2019

Nope, this looks like a pip limitation that requires their issue 6070 to be fixed. I just experimented with a few variations and none will choose the cryptography wheel unless you specify --python-version 34.

I don't have a recommendation right now other than to engage the projects and see what help we can provide. I'll ping both of them.

As a workaround, you could do this (tested separately but these commands need checking):

pip download --platform manylinux1_x86_64 --python-version 34 --abi abi3 cryptography --dest wheelhouse
mv wheelhouse/cryptography-2.6.1-cp34-abi3-manylinux1_x86_64.whl wheelhouse/cryptography-2.6.1-cp36.cp37-abi3.cp36m.cp37m-manylinux1_x86_64.whl
pip download --platform manylinux1_x86_64 --python-version 36 --abi cp36m --find-links wheelhouse -r requirements.txt

Renaming the cryptography wheel to include the ABI that you're going to download for in the name (dot separators let you specify multiple compatible versions) and using --find-links will avoid trying to download it again, though it will copy the wheel from wheelhouse to wherever the output of the second command is going.

@ankitkumarr
Copy link
Contributor

Thanks @zooba for the workaround and pinging the projects.

This issue comes up when we try and download wheels from user's requirements.txt. Even with that workaround, we would have to specify --python-version 34. The problem is- we would not know which version to specify for a given package from requirements.txt as I assume this problem is not exclusive to cryptography.

Unless, you are aware of a way to figure out which wheel version would satisfy a given python version. So, figuring out that we need cp34 wheel for cryptography if we want to download the wheel for version 36?

@zooba
Copy link
Member

zooba commented Mar 27, 2019

Nope, no way to figure that out. Which is why I said a temporary workaround is to special case cryptography (and presumably any others that we hear about).

@ahmedelnably
Copy link
Contributor

Blocked on pip getting updated

@kshyju
Copy link
Member

kshyju commented Aug 7, 2024

@vrdmr Is this still a valid issue? Can you advice what the action item here should be?

Copy link
Contributor

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

If you are not the original author (asavaritayal) and believe this issue is not stale, please comment with /bot not-stale and I will not close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants