[Python.NET] Request for help with Pythonnet Integration Error in Unity Project

河野晟生 <d23064fr-a8oCX6WZ+6+vIZrWX/[email protected]> Sun, 18 Aug 2024 12:30:17 +0900
Newsgroups gmane.comp.python.dotnet
Message-ID <CAB4oBw0D2f6oC_9v6W8MZMQTbZswY=SOmyNE8aFdvKBYdN+c-Q@mail.gmail.com>
--===============6663774700342511322==
Content-Type: multipart/alternative; boundary="0000000000005cc6b8061fecd037"

--0000000000005cc6b8061fecd037
Content-Type: text/plain; charset="UTF-8"

Dear Pythonnet Support Team,

I am currently working on a Unity project where I am using the Pythonnet
library to integrate Python scripts with C# code. Specifically, I am
attempting to utilize the HugChat library from within my Unity project.
However, I have encountered the following error:

PythonException: SystemError : initialization of md__mypyc did not return
an extension module
['  File
"C://Users//HOME/u3000anyone//AppData//Local//Programs//Python//Python38//lib//site-packages//hugchat//hugchat.py",
line 1, in <module>/n    import requests/n', '  File
"C://Users//HOME/u3000anyone//AppData//Local//Programs//Python//Python38//lib//site-packages//requests//__init__.py",
line 48, in <module>/n    from charset_normalizer import __version__ as
charset_normalizer_version/n', '  File
"C://Users//HOME/u3000anyone//AppData//Local//Programs//Python//Python38//lib//site-packages//charset_normalizer//__init__.py",
line 24, in <module>/n    from .api import from_bytes, from_fp, from_path,
is_binary/n', '  File
"C://Users//HOME/u3000anyone//AppData//Local//Programs//Python//Python38//lib//site-packages//charset_normalizer//api.py",
line 5, in <module>/n    from .cd import (/n', '  File
"C://Users//HOME/u3000anyone//AppData//Local//Programs//Python//Python38//lib//site-packages//charset_normalizer//cd.py",
line 14, in <module>/n    from .md import
is_suspiciously_successive_range/n']  at
Python.Runtime.Runtime.CheckExceptionOccurred () (at
<7702cb0f55bd42e3a72a1a6382f5edbc>:0)
Python.Runtime.PythonEngine.ImportModule (System.String name) (at
<7702cb0f55bd42e3a72a1a6382f5edbc>:0)
Python.Runtime.Py.Import (System.String name) (at
<7702cb0f55bd42e3a72a1a6382f5edbc>:0)
AIVtuberProject.get_response () (at Assets/Scripts/AIVtuberProject.cs:31)
AIVtuberProject.main_func () (at Assets/Scripts/AIVtuberProject.cs:75)
AIVtuberProject.OnSendButtonClicked () (at
Assets/Scripts/AIVtuberProject.cs:82)
System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0
(System.Object state) (at <b89873cb176e44a995a4781c7487d410>:0)
UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at
<10871f9e312b442cb78b9b97db88fdcb>:0)
UnityEngine.UnitySynchronizationContext.Exec () (at
<10871f9e312b442cb78b9b97db88fdcb>:0)
UnityEngine.UnitySynchronizationContext.ExecuteTasks () (at
<10871f9e312b442cb78b9b97db88fdcb>:0)

This error occurs when trying to import the requests module within HugChat.
I have confirmed that all necessary Python packages are installed and
accessible. I am using Python 3.8 with Pythonnet version 2.5.2.

I would greatly appreciate your assistance in resolving this issue. If you
need any additional information, please let me know.

Thank you in advance for your help.

Best regards,
Kouno Teruki

--0000000000005cc6b8061fecd037
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><p>Dear Pythonnet Support Team,</p><p>I am currently worki=
ng on a Unity project where I am using the Pythonnet library to integrate P=
ython scripts with C# code. Specifically, I am attempting to utilize the Hu=
gChat library from within my Unity project. However, I have encountered the=
 following error:</p><p>PythonException: SystemError : initialization of md=
__mypyc did not return an extension module<br>[&#39; =C2=A0File &quot;C://U=
sers//HOME/u3000anyone//AppData//Local//Programs//Python//Python38//lib//si=
te-packages//hugchat//hugchat.py&quot;, line 1, in &lt;module&gt;/n =C2=A0 =
=C2=A0import requests/n&#39;, &#39; =C2=A0File &quot;C://Users//HOME/u3000a=
nyone//AppData//Local//Programs//Python//Python38//lib//site-packages//requ=
ests//__init__.py&quot;, line 48, in &lt;module&gt;/n =C2=A0 =C2=A0from cha=
rset_normalizer import __version__ as charset_normalizer_version/n&#39;, &#=
39; =C2=A0File &quot;C://Users//HOME/u3000anyone//AppData//Local//Programs/=
/Python//Python38//lib//site-packages//charset_normalizer//__init__.py&quot=
;, line 24, in &lt;module&gt;/n =C2=A0 =C2=A0from .api import from_bytes, f=
rom_fp, from_path, is_binary/n&#39;, &#39; =C2=A0File &quot;C://Users//HOME=
/u3000anyone//AppData//Local//Programs//Python//Python38//lib//site-package=
s//charset_normalizer//api.py&quot;, line 5, in &lt;module&gt;/n =C2=A0 =C2=
=A0from .cd import (/n&#39;, &#39; =C2=A0File &quot;C://Users//HOME/u3000an=
yone//AppData//Local//Programs//Python//Python38//lib//site-packages//chars=
et_normalizer//cd.py&quot;, line 14, in &lt;module&gt;/n =C2=A0 =C2=A0from =
.md import is_suspiciously_successive_range/n&#39;] =C2=A0at Python.Runtime=
.Runtime.CheckExceptionOccurred () (at &lt;7702cb0f55bd42e3a72a1a6382f5edbc=
&gt;:0)<br>Python.Runtime.PythonEngine.ImportModule (System.String name) (a=
t &lt;7702cb0f55bd42e3a72a1a6382f5edbc&gt;:0)<br>Python.Runtime.Py.Import (=
System.String name) (at &lt;7702cb0f55bd42e3a72a1a6382f5edbc&gt;:0)<br>AIVt=
uberProject.get_response () (at Assets/Scripts/AIVtuberProject.cs:31)<br>AI=
VtuberProject.main_func () (at Assets/Scripts/AIVtuberProject.cs:75)<br>AIV=
tuberProject.OnSendButtonClicked () (at Assets/Scripts/AIVtuberProject.cs:8=
2)<br>System.Runtime.CompilerServices.AsyncMethodBuilderCore+&lt;&gt;c.&lt;=
ThrowAsync&gt;b__7_0 (System.Object state) (at &lt;b89873cb176e44a995a4781c=
7487d410&gt;:0)<br>UnityEngine.UnitySynchronizationContext+WorkRequest.Invo=
ke () (at &lt;10871f9e312b442cb78b9b97db88fdcb&gt;:0)<br>UnityEngine.UnityS=
ynchronizationContext.Exec () (at &lt;10871f9e312b442cb78b9b97db88fdcb&gt;:=
0)<br>UnityEngine.UnitySynchronizationContext.ExecuteTasks () (at &lt;10871=
f9e312b442cb78b9b97db88fdcb&gt;:0)<br></p><p>This error occurs when trying =
to import the <code>requests</code> module within HugChat. I have confirmed=
 that all necessary Python packages are installed and accessible. I am usin=
g Python 3.8 with Pythonnet version 2.5.2.</p><p>I would greatly appreciate=
 your assistance in resolving this issue. If you need any additional inform=
ation, please let me know.</p><p>Thank you in advance for your help.</p><p>=
Best regards,<br>Kouno Teruki</p></div>

--0000000000005cc6b8061fecd037--

--===============6663774700342511322==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Python.NET mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/pythonnet.python.org/
Member address: [email protected]

--===============6663774700342511322==--