Discussion:
[Python.NET] How to use Python for .NET? Have a problem to use in Windows 2008 R2 SP1
Seungweon Park
2013-03-22 20:44:46 UTC
Permalink
Hello,

I just downloaded pythonnet-2.0-Beta0-clr4.0_140_py27.zip from
http://sourceforge.net/projects/pythonnet/, and extract to c:\temp and ran
nPython.exe, got below error.

Current my test machine has
Windows 2008 R2 SP1 with Python 2.7.3 (32bit).

When looked the error, and googled it. someone says I need to copy
python27.dll into c:\windows\system32. However, I can't find the file. Any
idea?

Thank you,
Spark,

C:\temp\pythonnet20>nPython.exe

Unhandled Exception: System.DllNotFoundException: Unable to load DLL
'python27': The specified module could not be found
. (Exception from HRESULT: 0x8007007E)
at Python.Runtime.Runtime.Py_Initialize()
at Python.Runtime.Runtime.Initialize() in
D:\Users\Barton\Documents\Visual Studio 2010\Projects\PySharp\trunk\pythonn
et\src\runtime\runtime.cs:line 78
at Python.Runtime.PythonConsole.Main(String[] args) in
D:\Users\Barton\Documents\Visual Studio 2010\Projects\PySharp\
trunk\pythonnet\src\console\pythonconsole.cs:line 21
b***@public.gmane.org
2013-03-22 20:51:27 UTC
Permalink
python27.dll is likely not in your path. So it can't dynamically link to it. There are a lot of ways to remedy that.

Adding your python 2.7 install to your path.

Or moving the pythonnet binaries into your python 2.7 install.

You could also edit the .config file for the pythonnet install to give it an absolute path to the python2.7 on your system.

Adding python2.7 to your system directory probably isn't the best idea. If python 2.7 were meant to be installed to the "system" it would install there itself.

A long time ago, I used to make it a point to install my python from "activestate" installers rather than the default python installers, because their installer set up the bin and path variables for me and made sure that python was available system wide.

-brad
Post by Seungweon Park
Hello,
I just downloaded pythonnet-2.0-Beta0-clr4.0_140_py27.zip from http://sourceforge.net/projects/pythonnet/, and extract to c:\temp and ran nPython.exe, got below error.
Current my test machine has
Windows 2008 R2 SP1 with Python 2.7.3 (32bit).
When looked the error, and googled it. someone says I need to copy python27.dll into c:\windows\system32. However, I can't find the file. Any idea?
Thank you,
Spark,
C:\temp\pythonnet20>nPython.exe
Unhandled Exception: System.DllNotFoundException: Unable to load DLL 'python27': The specified module could not be found
. (Exception from HRESULT: 0x8007007E)
at Python.Runtime.Runtime.Py_Initialize()
at Python.Runtime.Runtime.Initialize() in D:\Users\Barton\Documents\Visual Studio 2010\Projects\PySharp\trunk\pythonn
et\src\runtime\runtime.cs:line 78
at Python.Runtime.PythonConsole.Main(String[] args) in D:\Users\Barton\Documents\Visual Studio 2010\Projects\PySharp\
trunk\pythonnet\src\console\pythonconsole.cs:line 21
_________________________________________________
http://mail.python.org/mailman/listinfo/pythondotnet
Loading...