[Python.NET] path question: clr.so being picky about paths

Joe Frayne Jfrayne at blizzard.com
Wed Dec 3 03:08:26 CET 2008

I got it working on MacOSX under Mono. I'm pretty sure the clr.pyd is only for Windows. I think you just need the Python.Runtime.dll, the Python.Runtime.dll.config, and the clr.so in the site-packages folder.


-----Original Message-----
From: pythondotnet-bounces+jfrayne=blizzard.com at python.org [mailto:pythondotnet-bounces+jfrayne=blizzard.com at python.org] On Behalf Of Hamilton Link
Sent: Tuesday, December 02, 2008 5:19 PM
To: pythondotnet at python.org
Subject: [Python.NET] path question: clr.so being picky about paths

In the readme, it says that "python for .net uses the pythonpath 
(sys.path) to look for assemblies to load, in addition to the usual 
application base and the gac.

Unfortunately at the moment the assembly I'm trying to load is... clr.pyd.

If I run python (ubuntu, mono, rebuilt python 2.5.2 with 
--enable-shared) from a directory where clr.pyd and Python.Runtime.dll 
reside, with clr.so in the lib/python2.5/site-packages folder... 
everything works.  I can import clr and System.Drawing and make a 
System.Drawing.Point instance.

If I run python from a directory without these libraries, in particular 
if I'm in my home folder somewhere and clr.pyd and Python.Runtime.dll 
are in the lib/python2.5/site-packages folder where I want them... 
import clr gives me an error trying to load some unspecified module (I 
suspect clr.pyd).

Am I supposed to set some path or other for mono in contravention of the 
docs?  I suspect that either clr.so can't find mono, or mono is being 
loaded and then can't find clr.pyd.

I will continue to fiddle with this, probably Friday, if I don't get a 
response, but it seems like there's probably a simple answer that I'm 
overlooking.  Setting MONO_PATH to my site-packages folder (the variable 
was unbound before) didn't fix it.


Python.NET mailing list - PythonDotNet at python.org

More information about the PythonDotNet mailing list