-
Notifications
You must be signed in to change notification settings - Fork 750
Python.Net (master branch) and Visual Studio 2015 on Windows 10 #259
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
@gatapia how are you running the embedding tests? command-line or VS UI? Is this failing on both root env (py3) and additional env (py27)? I got this weird PythonEngine.Initialize() call crash when using Python 2.7.11, which was caused by issues in CPython. I'll try to link that issue. |
VS UI (using resharper). py3 fails with DllNotFoundException py27 fails silently. I tried the Console project using command line and that also fails with message: "ImportError: No module named site". Trying to debug Console fails silently. |
what is the version of Anaconda 3? I assume this is Python 3.5? Did you change the compilation symbol from PYTHON27 to PYTHON35? |
Setting the compilation symbol to PYTHON35 appears to work. I was trying to load a 2.7 module tho. However, it may be simpler to upgrade my python code than workout why Win10+py27+pynet is not working. I'll give that a go but the issue still remains; i.e. pythonnet 64 + py27 + win10 does not appear to work. I tried on a Win10 machine without 3.x (only 27) and got the same issues. |
Here is the issue with python 2.7.11 (2 bugs in CPython) that I mentioned before, so try python 2.7.10 or python 2.7.12: |
@gatapia ok, I reproduced this issue with conda environments, and here is a quick fix for you:
|
just running activate py27 works for me, infact setting PYTHONHOME/PATH breaks it. Now I just need to find how to simulate the activate command in a .Net environment. Thanks for your help @denfromufa much appreciated. |
@gatapia all that activate.bat does is append %path% with python path in front. |
Thanks @denfromufa all sorted, my final incode solution is:
|
Note that there is an open issue about setting pythonpath and pythonhome from pythonnet: |
---EDIT--- Doing the same but not working! First added Python.Runtime.dll as a reference, Entire code is not included though to lack of space. |
I just made it work by setting platform target on x64 cause I'm using 64-bit system architecture. Source helping me: HERE |
Uh oh!
There was an error while loading. Please reload this page.
I'm having a bit of a hard time with a new box I've built. I have the following env:
conda create -n python2 python=2.7 anaconda
I am trying to get the
PyObjectTest
running. If I run this I get:System.DllNotFoundException : Unable to load DLL 'python27': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Ok looks like it may be trying to load python27 and python3.x is the default. So I add this to the test:
The Unit Test then fails with no exception with the following error: 'Aborted' (no more details). Debugging does not help.
I have looked at the FAQ and searched the google (event Bing!!) and whilst there is plenty of info out there it all looks old.
Anyone had any luck with this kind of setup, my ultimate goal is to embed python in a .Net application. I will try to put this in a console application to try to remove unit tests (and resharper) from the equation but I don't think that will help. Done: Verified using the
Console
project and it also fails silently on thePythonEngine.Initialize()
call.Note: I have verified that I am using 64 bit python (2.7 and 3.x) and I have verified that Python.Runtime and Python.Embedding.Tests are also targeting 64 bit so I dont think bitness is the issue.
The text was updated successfully, but these errors were encountered: