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

ImportError: dynamic module does not define init function (init_constant_time) #2612

Closed
harrisnb opened this issue Dec 31, 2015 · 8 comments
Closed

Comments

@harrisnb
Copy link

I get the following error:

libs/cryptography/hazmat/primitives/constant_time.py", line 9, in
from cryptography.hazmat.bindings._constant_time import lib
ImportError: dynamic module does not define init function (init_constant_time)

and could do with a little help. Any ideas where to start?

@alex
Copy link
Member

alex commented Dec 31, 2015

What platform are you on? How did you install cryptography?

@harrisnb
Copy link
Author

Name: cryptography
Version: 1.1.2

pip installed in virtual env on Mac OSX 10.11.2
Copied and running on GoogleAppEngine

@alex
Copy link
Member

alex commented Dec 31, 2015

I think you may be out of luck, my reading of the AppEngine FAQ is that libraries with extension modules are not supported: https://cloud.google.com/appengine/kb/#libraries

I think your best bet would be to ask a GAE forum for help.

@alex alex closed this as completed Dec 31, 2015
@harrisnb
Copy link
Author

oh no! ok, if I learn differently I'll come back here.

Anyway, thank you for your help.

@tjerkw
Copy link

tjerkw commented Mar 16, 2017

Appengine supports pycrypto. So you should use that.

Its so crappy the python libs that require these native libraries. It didnt compile on my macos box due to compiler issues.

@reaperhulk
Copy link
Member

@tjerkw You can't safely do cryptographic operations in pure Python in many scenarios, so the requirement for native libs can't be wished away. Additionally, if you are on an up-to-date pip cryptography supplies precompiled wheels for macOS. This allows you to install cryptography without a compiler or even an up-to-date copy of OpenSSL (which is statically linked in the wheel). The pip team continues to work to make it easier to install Python packages even when they have complex requirements like cryptographic packages do, but I'm sure they'd be quite welcoming of any new ideas you might have.

It is unfortunate that GAE can't support this project at this time, especially as pycrypto has several known CVEs, doesn't have some modern algorithms, uses its own bespoke C that has not undergone significant review, and is generally largely unsupported but this is the world we live in. Software interdependencies can be very complex (especially with a PaaS like GAE).

If you have a legitimate issue installing or using this project that isn't covered by our existing documentation please feel free to file a new issue.

@goginenir6
Copy link

Hey , Any one tell me please is this problem solved or not. I stuck here. "dynamic module does not define init function (init_constant_time)" Getting Error in GAE. I want to do Oauth login with Office 365. The back end modules using cryptography for decode. I don't know what I have to do.

@reaperhulk
Copy link
Member

There is still no support for cryptography on GAE. Rumor has it that may change with some new GAE features in the next 6 months, but at this time you're out of luck.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

5 participants