Thanks to visit codestin.com
Credit goes to github.com

Skip to content

nuget package embedding issue #647

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
user015 opened this issue Mar 20, 2018 · 8 comments
Closed

nuget package embedding issue #647

user015 opened this issue Mar 20, 2018 · 8 comments

Comments

@user015
Copy link

user015 commented Mar 20, 2018

nuget packages
a) 2.3.0-py35-dotnet
b) python 3.5.4 (64 bit).

I was able to get install both nuget packages. This pythondotnet package seems to look for a python35.dll, So I had to install 3.5.4. This is a 64 bit project targetting .NET 4.5

I set the path variables both PythonHome and PythonPath.

The code just abruptly exits at the Py.GIL() line, I tried looking at nuget issues here but no luck.

Code Snipped below

        PythonEngine.PythonHome = @"..\..\..\..\packages\Python.3.6.2\tools\";
        PythonEngine.PythonPath = @"..\..\..\..\packages\Python.3.6.2\tools\";
       
        using (Py.GIL())   ----> code Exits here with error code 3.

If I debug the PythonEngine variable, I see that it has the correct path and picks up the correct version and there is a error message under delegatemanager, which says delegate manager has not been initialized.
I tried to use the PythonEngine.Initialize() method and the progam Exits.
What could the issue be here ?

Thanks

@den-run-ai
Copy link
Contributor

@user015 you need to pick 64-bit of python.runtime.dll from nuget installation manually:

#472

@user015
Copy link
Author

user015 commented Mar 20, 2018

I did that already. it was initially 32 bit but I picked up 64 bit manually.

@den-run-ai
Copy link
Contributor

den-run-ai commented Mar 20, 2018 via email

@user015
Copy link
Author

user015 commented Mar 20, 2018

my bad, I pasted a older copy. I am using 3.5.4 as shown below.

          PythonEngine.PythonHome = @"..\..\..\..\packages\Python.3.5.4\tools";
        PythonEngine.PythonPath = @"..\..\..\..\packages\Python.3.5.4\tools";

As I wrote earlier, the error I see when I debug PythonEngine is this

base {System.SystemException} = {"DelegateManager has not yet been initialized using Python.Runtime.PythonEngine.Initialize()."}

@user015
Copy link
Author

user015 commented Mar 20, 2018

image

@den-run-ai
Copy link
Contributor

den-run-ai commented Mar 21, 2018 via email

@user015
Copy link
Author

user015 commented Mar 21, 2018

OK nuget package does not seem like a good option now. Also the nuget package for pythonnet seems to look for older version of python3.5.5 (python35.dll) as well. I was looking at this for distribution purposes, will go back to the regular setup. Thanks for all your help @denfromufa.

@filmor filmor closed this as completed Aug 8, 2021
@lostmsu
Copy link
Member

lostmsu commented Aug 9, 2021

The latest versions of NuGet package now work with any supported Python version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants