Topic: [SOLVED] _ffi ImportError: No module named _ffi

Hi, I'm working in a Python project on Raspberry Pi .
I followed this tutorial: "https://wolfssl.github.io/wolfcrypt-py/" that I give on another thread to can build WolfSSL. But after it  I'm getting some troubles.

When I import a module like 'ciphers.py' or 'hashes.py' in my python project, I get the error: "ffi import from wolfcrypt._ffi as _ffi ImportError: No module named _ffi".

Where is this module? How can I import it into my python project correctly? Thank you so much in any case for all the help received so far, you're saving me.

Share

Re: [SOLVED] _ffi ImportError: No module named _ffi

Hi jesussotofan,


I checked with our python expert and he said this is a very common issue.


if you run python inside wolfssl/wrapper/python
it will try to use the local code instead of the installed one.
the local code doesn’t have the _ffi module, it is built during the building process.

    - Moisés Guimarães

His suggestion is to run python from a different location and if you have similar issue then take a screenshot or echo the error output to a file and send to us for review.


- Kaleb

Re: [SOLVED] _ffi ImportError: No module named _ffi

Many thanks!! It works!
I'm going crazy trying everything, but finally it works, I have just to make the execution in a different location.

Really thank you for everything Kaleb.

Share

Re: [SOLVED] _ffi ImportError: No module named _ffi

Hi jesussotofan,

Not a problem. Happy we could assist you with this project!


Regards,

Kaleb and the wolfSSL Team

Re: [SOLVED] _ffi ImportError: No module named _ffi

Hi Kaleb and Jesussotofan

I have met the problem 'no module _ffi' also.
I am using python virtualvenv. I tried to run python in upper folder, but id does not work.

So I think I do not under what do you mean of running python in different location.

Can you tell me more? Thanks a lot!

regards
Anders

Share

Re: [SOLVED] _ffi ImportError: No module named _ffi

Hi Anders,

Are you building wolfCrypt Pi?

Thanks,
Eric - wolfSSL Support