-
Notifications
You must be signed in to change notification settings - Fork 750
nuget error - windows 10 - Anaconda Python 3.5.2 64 bit #472
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
@mphielipp are you really using VS 2005??? Your anaconda is clearly 64-bit, hence you need to select x64 target in VS. Which nuget pythonnet package did you install? There are many versions of them. What .NET runtime are you targetting? What do these commands show?
|
VS 2015 |
.NET Framework 4.5.2 |
pythonnet_py35_dotnet 2.3.0 |
I see the issue, nuget does not switch automatically the version of package (x86 and x64) depending on the architecture: |
@denfromufa looks like you arrived to the same solution we did. We got it fixed by manually updating the dll reference to the 64bit version. I don't know how other libraries deal w this though, dllexport and nunit may have some solution for this. |
@denfromufa i would like to confirm my understanding on this issue. |
Currently you have to do a manual workaround as suggested above.
Nuget does not support architecture detection.
…On Tue, Aug 14, 2018, 12:06 PM STREETKILLER007 ***@***.***> wrote:
@denfromufa <https://github.com/denfromufa> i would like to confirm my
understanding on this issue.
Do you mean that currently, the System.BadImageFormatException error still
have not been solve if we downloaded Pythonnet from NuGet.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#472 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHgZ5VTNeonA4_iIZjpyHh4nhmoDPoHhks5uQwOogaJpZM4NmyJp>
.
|
I don't think this is something we can easily solve in code. We could, however, provide different NuGet packages for all relevant arch/python version combinations. |
@filmor this should be possible with the new .NET Core nuget packages. They even support different target platforms. |
That would still not solve the issue of different Python versions, would it? |
@filmor , no, it would not. Python versions issue, IMHO, should either be solved by having separate NuGet package names per python version (e.g pythonnet36 instead of pythonnet), or by having all versions in a single package. |
@lostmsu can you provide references for the new nuget package specs of platform definitions? |
@denfromufa , I can't find a tutorial, but this is what I am talking about: https://docs.microsoft.com/en-us/dotnet/core/rid-catalog |
This looks like exactly what we were looking for!
This should make it possible to provide platform dependent binaries.
…On Mon, Dec 3, 2018, 2:30 PM Victor ***@***.***> wrote:
@denfromufa <https://github.com/denfromufa> , I can't find a tutorial,
but this is what I am talking about:
https://docs.microsoft.com/en-us/dotnet/core/rid-catalog
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#472 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHgZ5QYNL43zzs0R_0FrdC39WCp9aBJJks5u1YnygaJpZM4NmyJp>
.
|
This has been solved with the introduction of |
Uh oh!
There was an error while loading. Please reload this page.
from @mphielipp
Hi, I install this package. But when I run the project I get a runtime error . I have a Anaconda Python 3.5.2 64 bits install. I use the Nuget PAckage 3.5. I have tried to run it with x86, Any CPU, amd x64. Any suggestions?
Now I'm running x86. Crash in this line Py.GIL().
There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "Python.Runtime, Version=2.3.0.0, Culture=neutral, processorArchitecture=x86", "x86". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project. PythonNet2
Windows 10
I installed it using the "MAnage Nuget Package" option in Visual Studio 2005.
I changed the "Target Platform Option" in project settings to x86. But I still get this runtime error in the same line:
An unhandled exception of type 'System.BadImageFormatException' occurred in Python.Runtime.dll
Additional information: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
The text was updated successfully, but these errors were encountered: