0

When importing _constant_time

I was getting attribution error: _init.cffi_1_0_external_module

I decided to go check in _constant_time. And what is discover is _constant_time is not a python module but rather a cpp compiled library. (.so) .

So how is python importing from .so file? Or is something missing in cryptographic package?

Ciasto piekarz
  • 7,853
  • 18
  • 101
  • 197

1 Answers1

1

According to an answer on Russian StackOverflow, you need to install cffi module as well.

sudo easy_install -U cffi

or

sudo pip install -U cffi

And on Windows the syntax is more like:

python -m pip install -U cffi

(according to How to run Pip commands from CMD?)

-m is needed on Windows since Windows doesn't interpret "shebang" (#!) interpreter lines so pip can't be run directly as on Linux/BSD/Unix/whatever, but needs to be run from python. -U tells pip or easy_install to install latest version of cffi available.

English version of linked Russian page

Nathan Mills
  • 2,243
  • 2
  • 9
  • 15