You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(Pythonnet newbie). Trying to embed Pythonnet in a simple WPF app. Built Python.Runtime from source setting PYTHON3 and PYTHON36 on x64. Gets to GetCLRModule in importhook.cs and gets in infinite loop in root.LoadNames() line 98, ultimately crashes.
Thanks for the quick response. The code is very, very simple -- click on a WPF menu and the click handler calls PythonEngine.Initialize(). When I trace into root.LoadNames() there is the following code:
{
ManagedType m = null;
foreach (string name in AssemblyManager.GetNames(_namespace))
{
cache.TryGetValue(name, out m);
if (m == null)
{
ManagedType attr = GetAttribute(name, true);
}
}
}
The 'names' that it loads are: "FXAssembly", "ThisAssembly", "AssemblyRef", "", and then it starts trying to load what seems like types "_StaticArrayInitTypeSize=6" and then 8, and so on. It does this forever.
I have a feeling this may be because there is some required assembly or .py file or something like that it's looking for, but I can't find it.
UPDATE: I should add in my bin\debug folder there are: clr.py, clr.pyd, Python.Runtime.dll, python3.dll and python36.dll ... missing anything?
npython loads. However, the demo apps do not run (assuming I typed the command correctly, which, as a Python newbie, I may not have):
>>> exec(open("Z:\demo\helloform.py").read())
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscorlib.dll
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<string>", line 8, in <module>
ModuleNotFoundError: No module named 'System'
Activity
den-run-ai commentedon Jan 23, 2018
@barrybriggs how can someone reproduce this issue? Did you look at troubleshooting and installation wikis? Does this happen without WPF (in console)?
barrybriggs commentedon Jan 23, 2018
Thanks for the quick response. The code is very, very simple -- click on a WPF menu and the click handler calls
PythonEngine.Initialize(). When I trace intoroot.LoadNames()there is the following code:The 'names' that it loads are: "FXAssembly", "ThisAssembly", "AssemblyRef", "", and then it starts trying to load what seems like types "_StaticArrayInitTypeSize=6" and then 8, and so on. It does this forever.
I have a feeling this may be because there is some required assembly or .py file or something like that it's looking for, but I can't find it.
UPDATE: I should add in my bin\debug folder there are: clr.py, clr.pyd, Python.Runtime.dll, python3.dll and python36.dll ... missing anything?
den-run-ai commentedon Jan 24, 2018
Do the demo apps work for you? Your example is still not reproducible.
barrybriggs commentedon Jan 24, 2018
npythonloads. However, the demo apps do not run (assuming I typed the command correctly, which, as a Python newbie, I may not have):PATHandPYTHONHOMEare set correctly.dmitriyse commentedon Jan 24, 2018
Please try "featured" branch. At least problems with "_StaticArrayInitTypeSize=6" types are eliminated.
barrybriggs commentedon Jan 24, 2018
@dmitriyse That seems to have cured the problem. Thanks!!
den-run-ai commentedon Jan 28, 2018
@dmitriyse what is the corresponding commit that fixes this "_StaticArrayInitTypeSize=6". I have not seen this issue before.
dmitriyse commentedon Jan 28, 2018
This is the corresponding PR #528
den-run-ai commentedon Nov 14, 2018
closed by #723