-
Notifications
You must be signed in to change notification settings - Fork 747
Could not load file or assembly 'Python.Runtime, Version=2.4.0.0... #665
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
Comments
@tomunger use this tool to strongly sign Python.Runtime.DLL with a key, e.g. the one provided with pythonnet: |
Does this mean that I must sign the DLL on all systems my application is used on? That does not seem scalable. Also, I came across articles against strong naming and microsoft suggests against it. How do other apps that embed Python solve this? It seems that it should be very simple... |
@tomunger the solution is simple - don't use GAC! |
I'm trying to not use GAC! |
@tomunger this has nothing to do with pythonnet, but you can set custom load path for reference DLLs: |
Did you also check about this(NTFS Security, Blocking)? |
@denfromufa thanks for that link. I know about private path and it does not resolve my issue. The standard approach is to distribute DLLs for the assemblies your application depends on WITH your application. However, in the case of Python.Net I don't want to do this. Different versions of Python require different DLLs (right?). What I want to do is use the DLL installed with Python - thus not in my application directory anywhere.
|
@tomunger good finding! Yes, pythonnet has some build time compiler flags for specific Python versions even in Python.Runtime.DLL CLR assembly. @dmitriyse was working on approach to resolve these APIs at runtime, but I'm not sure how far he was able to accomplish this. |
@dmitriyse @denfromufa is there an issue tracking this? I am also interested in a generic binding, that could be used with any Python installation across platforms. |
I have made great work to isolate C-Calls (that gave an ability to load different python dlls at runtime). But it was so big changes that nobody elso wants to work with that. |
@dmitriyse can you share the branch? |
Sorry, this branch is not in GH now. I have spent around 4 working days to carefully add indirection into runtime.cs C-Calls and all other wrapping code. |
Environment
Details
I have used
pip install git+https://github.com/pythonnet/pythonnet
to install latest python net.
I've created a .NET visual studio 2015 project to make calls to Python. I reference the Python.Runtime.dll file in the project. When I let it get copied to the binary directory of my project calls to CPython work fine.
Now, I don't want to bundle the DLL with my application. As I understand, different versions work with different versions of CPython. I would like to load Python.Runtime.dll from Lib\site-packages so I get version appropriate for version of Python installed on the system. I change properties of the PythonRuntime.dll reference to NOT copy the DLL to bin directory. Now I get the error:
This minimal program causes the error.
I've tracked down other issues related to this but none seem to simply be that the DLL is not found.
When I try to install the assembly in the GAC I get
Thanks
The text was updated successfully, but these errors were encountered: