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
When I try to intialise the interpreter, I get this message:
Managed Debugging Assistant 'PInvokeStackImbalance' : 'A call to PInvoke function 'Python.Runtime!Python.Runtime.Runtime::Py_SetPythonHome' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.'
and the exception occurs on the first line. pypath points to a directory containing the entire contents of the "Windows x86 embeddable zip file" of Python 3.5.3 on python.org.
Do you get the same issue with pythonnet built from the master? E.g. you
can install
´pip install git+https://github.com/pythonnet/pythonnet´
from full CPython installation.
On Sat, Jun 10, 2017, 12:44 PM Declan Hoare ***@***.***> wrote:
Environment
- Pythonnet version: pythonnet_py35_dotnet v2.3.0 (from NuGet)
- Python version: Python 3.5.3
- Operating System: Windows 7 x86_64
Details
- When I try to intialise the interpreter, I get this message:
Managed Debugging Assistant 'PInvokeStackImbalance' : 'A call to PInvoke function 'Python.Runtime!Python.Runtime.Runtime::Py_SetHome' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.'
The code I'm using is
PythonEngine.PythonHome = pypath;
PythonEngine.ProgramName = "PythonAPI";
PythonEngine.Initialize();
pylock = PythonEngine.AcquireLock();
AppDomain.CurrentDomain.ProcessExit += (o, a) => { PythonEngine.ReleaseLock(pylock); };
PythonEngine.Exec(Properties.Resources.PythonAPI);
and the exception occurs on the first line. pypath points to a directory
containing the entire contents of the "Windows x86 embeddable zip file" of
Python 3.5.3 on python.org.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#485>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHgZ5eYofMwPj013TFn4OZWRxth9bXPRks5sCtYMgaJpZM4N2LSK>
.
Having installed that I can use the clr module from within Python to interact with C# types perfectly, but I can't see how to embed that in my .NET application.
On Sun, Jun 11, 2017, 11:36 AM Declan Hoare ***@***.***> wrote:
Having installed that I can use the clr module from within Python to
interact with C# types perfectly, but I can't see how to embed that in my
.NET application.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#485 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHgZ5R8oei5xdRDS2w9W4uzXRPXgR07oks5sDBdxgaJpZM4N2LSK>
.
System.BadImageFormatException: 'Could not load file or assembly 'Python.Runtime, Version=2.4.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.'
On Sun, Jun 11, 2017, 12:55 PM Declan Hoare ***@***.***> wrote:
With this method, I get a different exception.
System.BadImageFormatException: 'Could not load file or assembly 'Python.Runtime, Version=2.4.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.'
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#485 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHgZ5en6J60FMbDiO6SMTu6rYLFHq3pfks5sDCoagaJpZM4N2LSK>
.
Okay, the library is working perfectly for me now. Thanks for your help. I'm not sure whether to close the issue or not, because of the issue with the NuGet package.
Activity
den-run-ai commentedon Jun 10, 2017
DeclanHoare commentedon Jun 11, 2017
Having installed that I can use the clr module from within Python to interact with C# types perfectly, but I can't see how to embed that in my .NET application.
den-run-ai commentedon Jun 11, 2017
DeclanHoare commentedon Jun 11, 2017
With this method, I get a different exception.
den-run-ai commentedon Jun 11, 2017
DeclanHoare commentedon Jun 11, 2017
But... it doesn't have any instructions on what to do about it.
DeclanHoare commentedon Jun 11, 2017
Oh, I'm blind. Sorry.
DeclanHoare commentedon Jun 11, 2017
Okay, the library is working perfectly for me now. Thanks for your help. I'm not sure whether to close the issue or not, because of the issue with the NuGet package.
den-run-ai commentedon Jun 14, 2017
This is similar issue as this one:
#448
We can close this issue once next release is available.
filmor commentedon Nov 15, 2018
As this is apparently fixed on master, I'll close the issue.