<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[wolfSSL - Embedded SSL Library — [SOLVED] _ffi ImportError: No module named _ffi]]></title>
		<link>https://www.wolfssl.com/forums/topic867-solved-ffi-importerror-no-module-named-ffi.html</link>
		<atom:link href="https://www.wolfssl.com/forums/feed-rss-topic867.xml" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in [SOLVED] _ffi ImportError: No module named _ffi.]]></description>
		<lastBuildDate>Tue, 15 Oct 2024 02:03:26 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: [SOLVED] _ffi ImportError: No module named _ffi]]></title>
			<link>https://www.wolfssl.com/forums/post7943.html#p7943</link>
			<description><![CDATA[<p>The code</p><div class="codebox"><pre><code>(.venv) ~/d-net $ cat main.py
import socket
import wolfssl

sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)

secure_socket = wolfssl.wrap_socket(sock)
secure_socket.connect((&quot;dns.google.com&quot;, 443))
secure_socket.write(b&quot;GET / HTTP/1.1\r\n\r\n&quot;)
print(secure_socket.read())
secure_socket.close()

(.venv) ~/d-net $</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (reyuki)]]></author>
			<pubDate>Tue, 15 Oct 2024 02:03:26 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post7943.html#p7943</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] _ffi ImportError: No module named _ffi]]></title>
			<link>https://www.wolfssl.com/forums/post7942.html#p7942</link>
			<description><![CDATA[<p>The error log</p><div class="codebox"><pre><code>(.venv) ~ $ cd d-net/
(.venv) ~/d-net $ python main.py
Traceback (most recent call last):
  File &quot;/data/data/com.termux/files/home/d-net/main.py&quot;, line 6, in &lt;module&gt;
    secure_socket = wolfssl.wrap_socket(sock)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File &quot;/data/data/com.termux/files/home/d-net/.venv/lib/python3.12/site-packages/wolfssl/__init__.py&quot;, line 976, in wrap_socket
    return SSLSocket(sock=sock, keyfile=keyfile, certfile=certfile,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File &quot;/data/data/com.termux/files/home/d-net/.venv/lib/python3.12/site-packages/wolfssl/__init__.py&quot;, line 407, in __init__
    self._context = SSLContext(ssl_version, server_side)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File &quot;/data/data/com.termux/files/home/d-net/.venv/lib/python3.12/site-packages/wolfssl/__init__.py&quot;, line 144, in __init__
    _lib.wolfSSL_Init()
    ^^^^
NameError: name &#039;_lib&#039; is not defined
Exception ignored in: &lt;function SSLContext.__del__ at 0x742a00c9a0&gt;
Traceback (most recent call last):
  File &quot;/data/data/com.termux/files/home/d-net/.venv/lib/python3.12/site-packages/wolfssl/__init__.py&quot;, line 167, in __del__
    if getattr(self, &#039;native_object&#039;, _ffi.NULL) != _ffi.NULL:
                                      ^^^^
NameError: name &#039;_ffi&#039; is not defined
Exception ignored in: &lt;function SSLSocket.__del__ at 0x742a00d300&gt;
Traceback (most recent call last):
  File &quot;/data/data/com.termux/files/home/d-net/.venv/lib/python3.12/site-packages/wolfssl/__init__.py&quot;, line 469, in __del__
    self._release_native_object()
  File &quot;/data/data/com.termux/files/home/d-net/.venv/lib/python3.12/site-packages/wolfssl/__init__.py&quot;, line 472, in _release_native_object
    if getattr(self, &#039;native_object&#039;, _ffi.NULL) != _ffi.NULL:
                                      ^^^^
NameError: name &#039;_ffi&#039; is not defined
(.venv) ~/d-net $</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (reyuki)]]></author>
			<pubDate>Tue, 15 Oct 2024 02:02:01 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post7942.html#p7942</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] _ffi ImportError: No module named _ffi]]></title>
			<link>https://www.wolfssl.com/forums/post7941.html#p7941</link>
			<description><![CDATA[<p>I have the same problem as qt4004 on Android 14 termux:</p><div class="codebox"><pre><code>(.venv) ~ $ pkg info libwolfssl
Package: libwolfssl
Version: 5.7.2
Maintainer: @termux
Installed-Size: 3891 kB
Homepage: https://www.wolfssl.com/
Download-Size: 630 kB
APT-Manual-Installed: yes
APT-Sources: https://mirrors.bfsu.edu.cn/termux/apt/termux-main stable/main aarch64 Packages
Description: A small, fast, portable implementation of TLS/SSL for embedded devices to the cloud

(.venv) ~ $ pip list
Package   Version
--------- -----------
cffi      1.17.1
pip       24.2
pycparser 2.22
wolfssl   5.7.2.post0
(.venv) ~ $</code></pre></div><p>Please enlight me what&#039;s wrong and how to solve it?</p>]]></description>
			<author><![CDATA[null@example.com (reyuki)]]></author>
			<pubDate>Tue, 15 Oct 2024 01:59:44 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post7941.html#p7941</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] _ffi ImportError: No module named _ffi]]></title>
			<link>https://www.wolfssl.com/forums/post7543.html#p7543</link>
			<description><![CDATA[<p>Hi Anders,</p><p>Are you building wolfCrypt Pi?</p><p>Thanks,<br />Eric - wolfSSL Support</p>]]></description>
			<author><![CDATA[null@example.com (embhorn)]]></author>
			<pubDate>Mon, 04 Mar 2024 16:05:39 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post7543.html#p7543</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] _ffi ImportError: No module named _ffi]]></title>
			<link>https://www.wolfssl.com/forums/post7541.html#p7541</link>
			<description><![CDATA[<p>Hi Kaleb and Jesussotofan</p><p>I have met the problem &#039;no module _ffi&#039; also.<br />I am using python virtualvenv. I tried to run python in upper folder, but id does not work.</p><p>So I think I do not under what do you mean of running python in different location.</p><p>Can you tell me more? Thanks a lot!</p><p>regards<br />Anders</p>]]></description>
			<author><![CDATA[null@example.com (qt4004)]]></author>
			<pubDate>Sun, 03 Mar 2024 07:30:11 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post7541.html#p7541</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] _ffi ImportError: No module named _ffi]]></title>
			<link>https://www.wolfssl.com/forums/post2780.html#p2780</link>
			<description><![CDATA[<p>Hi jesussotofan,</p><p>Not a problem. Happy we could assist you with this project!</p><br /><p>Regards,</p><p>Kaleb and the wolfSSL Team</p>]]></description>
			<author><![CDATA[null@example.com (Kaleb J. Himes)]]></author>
			<pubDate>Tue, 25 Oct 2016 16:11:43 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post2780.html#p2780</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] _ffi ImportError: No module named _ffi]]></title>
			<link>https://www.wolfssl.com/forums/post2778.html#p2778</link>
			<description><![CDATA[<p>Many thanks!! It works!<br />I&#039;m going crazy trying everything, but finally it works, I have just to make the execution in a different location.</p><p>Really thank you for everything Kaleb.</p>]]></description>
			<author><![CDATA[null@example.com (jesussotofan)]]></author>
			<pubDate>Fri, 21 Oct 2016 10:31:50 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post2778.html#p2778</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] _ffi ImportError: No module named _ffi]]></title>
			<link>https://www.wolfssl.com/forums/post2775.html#p2775</link>
			<description><![CDATA[<p>Hi jesussotofan,</p><br /><p>I checked with our python expert and he said this is a very common issue.</p><br /><div class="quotebox"><blockquote><p>if you run python inside wolfssl/wrapper/python<br />it will try to use the local code instead of the installed one.<br />the local code doesn’t have the _ffi module, it is built during the building process.</p></blockquote></div><p>&nbsp; &nbsp; - Moisés Guimarães</p><p>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.</p><br /><p>- Kaleb</p>]]></description>
			<author><![CDATA[null@example.com (Kaleb J. Himes)]]></author>
			<pubDate>Thu, 20 Oct 2016 20:02:19 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post2775.html#p2775</guid>
		</item>
		<item>
			<title><![CDATA[[SOLVED] _ffi ImportError: No module named _ffi]]></title>
			<link>https://www.wolfssl.com/forums/post2767.html#p2767</link>
			<description><![CDATA[<p>Hi, I&#039;m working in a Python project on Raspberry Pi .<br />I followed this tutorial: &quot;<a href="https://wolfssl.github.io/wolfcrypt-py/">https://wolfssl.github.io/wolfcrypt-py/</a>&quot; that I give on another thread to can build WolfSSL. But after it&nbsp; I&#039;m getting some troubles.</p><p>When I import a module like &#039;ciphers.py&#039; or &#039;hashes.py&#039; in my python project, I get the error: &quot;ffi import from wolfcrypt._ffi as _ffi ImportError: No module named _ffi&quot;.</p><p>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&#039;re saving me.</p>]]></description>
			<author><![CDATA[null@example.com (jesussotofan)]]></author>
			<pubDate>Thu, 20 Oct 2016 11:12:43 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post2767.html#p2767</guid>
		</item>
	</channel>
</rss>
