-
Notifications
You must be signed in to change notification settings - Fork 750
Two differnt exceptions on x64 and x86 in VS calling python script #478
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
default key in InstallPath: C:\Users\XXXX\AppData\Local\Programs\Python\Python35\python.exe |
we found last week that VS does not switch architecture for Nuget installed package. You have to do it manually: |
#472 I saw that one and it was not clear to me how to update manually would you please elaborate a bit more? Thanks! |
Go to nuget package location and select x86 or x64 folder and add this
reference manually to the project as assembly (not nuget package).
…On Tue, May 30, 2017, 4:49 PM keowang ***@***.***> wrote:
#472 <#472> I saw that one
and it was not clear to me how to update manually would you please
elaborate a bit more? Thanks!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#478 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHgZ5XiyywHjlQeYs1BBNaUcKpAlekJqks5r_I72gaJpZM4NqrPt>
.
|
Here is what I did you can correct me whenever I am wrong:
|
Also you are not answering my question why is it two different errors if it were for the architecture compatibility issue one of the two should be working shouldn't it? |
I just checked and it is working fine with 64-bit Python 3.5. You can only use x64 or x86 corresponding to Python architecture, so can you show full output of |
C:\Users\XXXX>python --version I installed the 64 bit python which did not work with either x64 or x86 |
Specifically on x64 it's complaining An unhandled exception of type 'System.DllNotFoundException' occurred in Python.Runtime.dll Additional information: Unable to load DLL 'python35': The specified module could not be found. (Exception from HRESULT: 0x8007007E) |
Can you install with pip instead of nuget?
…On Tue, May 30, 2017, 5:33 PM keowang ***@***.***> wrote:
Specifically on x64 it's complaining
An unhandled exception of type 'System.DllNotFoundException' occurred in
Python.Runtime.dll
Additional information: Unable to load DLL 'python35': The specified
module could not be found. (Exception from HRESULT: 0x8007007E)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#478 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHgZ5fihUBXz-WJkE3WF8FLZT5UVRGulks5r_Jk3gaJpZM4NqrPt>
.
|
like this: |
pip install pythonnet
…On Tue, May 30, 2017, 5:39 PM keowang ***@***.***> wrote:
like this:
pip install git+https://github.com/pythonnet/pythonnet
?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#478 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHgZ5TZZlAsBXVZU_-uGS5aoZ7l0MhIqks5r_JqVgaJpZM4NqrPt>
.
|
Hay, this thing is killing me I would appreciate if you bear with me.
|
Did you add your python to path?
%Python_home% is wrong environment variable, it should be without
underscore.
https://github.com/pythonnet/pythonnet/wiki/Troubleshooting-on-Windows-and-Linux
…On Tue, May 30, 2017, 6:03 PM keowang ***@***.***> wrote:
Hay, this thing is killing me I would appreciate if you bear with me.
1. pip install pythonnet-2.3.0-cp35-cp35m-win_amd64.whl
2. add Python.Runtime.dll from
C:\Users\XXX\AppData\Local\Programs\Python\Python35\Lib\site-packages to my
C# application
3. run example again. Exactly same error.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#478 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHgZ5bQb-O2nFmyItFPnWg0NyLWKnfTGks5r_KA-gaJpZM4NqrPt>
.
|
"Installed CPython is reachable by %PATH% or %PYTHONHOME% environment variables." Maybe change the or to and since PYTHON_HOME is added to PATH? It worked, thanks very much! |
Pythonhome is needed for embedding python, while python in path is only when starting the Python interpreter. |
last question, would python3.6 work with pythonnet-2.3.0-cp35? |
You can install for python 3.6 with pip from PyPi:
https://pypi.python.org/pypi/pythonnet/2.3.0
Another thing about pythonhome is that it is only required for python
installation, that is not registered globally on the machine or when
multiple python versions are installed.
…On Tue, May 30, 2017, 7:19 PM keowang ***@***.***> wrote:
last question, would python3.6 work with pythonnet-2.3.0-cp35?
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#478 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHgZ5RCql1d-V0QlAsAPG4ZYoqQTfSDfks5r_LH9gaJpZM4NqrPt>
.
|
thanks! |
Environment
Details
Running Embedding Python in .NET on x86 Py.GIL() triggers the following:
An unhandled exception of type 'System.DllNotFoundException' occurred in Python.Runtime.dll
Additional information: Unable to load DLL 'python35': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
on x64 a different one:
An unhandled exception of type 'System.BadImageFormatException' occurred in mscorlib.dll
Additional information: Could not load file or assembly 'Python.Runtime, Version=2.3.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Searched for the similar issues some are pointing to the Nuget error in switching platforms but if that's the case one of the two should work right?
where python: C:\Users\XXX\AppData\Local\Programs\Python\Python35\python.exe
python --version: Python 3.5.3
%PYTHON_HOME%: C:\Users\XXX\AppData\Local\Programs\Python\Python35
%PYTHONPATH%: C:\Users\XXXX\AppData\Local\Programs\Python\Python35\Lib
The only thing I want to do is to call Python scripts from C# application. It would be great if there is a simple short cut.
The text was updated successfully, but these errors were encountered: