Skip to content

Unable to load DLL 'python36': The specified module could not be found. (Exception from HRESULT: 0x8007007E #871

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
kfavara opened this issue May 23, 2019 · 4 comments

Comments

@kfavara
Copy link

kfavara commented May 23, 2019

Environment

  • Pythonnet version: 2.4
  • Python version: 3.6
  • Operating System: Win 10
  • .Net Framework 4.5.2
  • Visual Studio 2017

Details

  • Implement Python within .Net using Pythonnet

I have been researching all day and have tried everything I could find. It crashes when trying to set the PythonHome variable.

Python is installed at c:\Python36.
Paths were added for C:\Python36, C:\Python36\lib\site-packages, C:\Python36\scripts, C:\Python36\lib (redundant, but they were added one at a time trying ANYTHING).

I have added the following to try and fix path variables.

        string envPythonHome = @"C:\Python36";
        string envPythonLib = envPythonHome + @"\Lib\site-packages";
        PythonEngine.PythonHome = envPythonHome;
        PythonEngine.PythonPath = Environment.GetEnvironmentVariable("PYTHONPATH");
        Environment.SetEnvironmentVariable("PYTHONHOME", envPythonHome, EnvironmentVariableTarget.Process);
        Environment.SetEnvironmentVariable("PATH", envPythonHome + ";" + Environment.GetEnvironmentVariable("PATH", EnvironmentVariableTarget.Machine),
            EnvironmentVariableTarget.Process);

        Environment.SetEnvironmentVariable("PYTHONPATH", envPythonLib, EnvironmentVariableTarget.Process);

        PythonEngine.Initialize();

I installed using pip install pythonnet

I have upgraded pip, setuptools, installed wheel

I have tried using the build target x64 and x86.

I checked the

I followed all of these links and couldn't find anything undone.
#259 #463 #467

I made sure the python36 was in the python.runtime.csproj.

I made sure the python.runtime.dll was in the site-packages folder that was referenced in the path.

I am sure there are additional steps I have tried, but that is all I can remember at the moment. Any suggestions would be greatly appreciated.

@lidanger
Copy link

lidanger commented May 24, 2019

May it be about solution compile configuration. DebugWinPY3 will be OK on Windows while DebugMonoPY3 for Linux.

@kfavara
Copy link
Author

kfavara commented May 24, 2019

May it be about solution compile configuration. DebugWinPY3 will be OK on Windows while DebugMonoPY3 for Linux.

Where do I go to look for this? It was not in the project file.

@lidanger
Copy link

lidanger commented May 24, 2019

It is in the project file.You may be hard to find that.
While in Visual Studio, you can get that on standard toolbar.That's quite simple.

@kfavara

@filmor
Copy link
Member

filmor commented Jun 14, 2019

@lidanger Thanks for helping out :)
@kfavara I'll close this now, just comment again if you have follow up issues.

@filmor filmor closed this as completed Jun 14, 2019
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

3 participants