Skip to content

Python.Runtime.dll.config under Mac OSX, Anaconda and brew mono #120

Closed
@spichardo

Description

@spichardo

Hi,

First I installed mono with brew:
brew install mono

With anaconda under OSX El Capitan I managed to install pythonnet with no issues the development version with
pip install --pre pythonnet

Then, when trying to import clr in python I got the error
ImportError: System.DllNotFoundException: libpython2.7.so

I noticed the error was in Python.Runtime.dll.config since it assumes that any non-windows OS will have .so as extension for the libpython library; by example libpython2.7**.so** , but in anaconda and OSX, this should be libpython2.7.dylib.

This can be easily fixed by being more specific in Python.Runtime.dll.config about the os, such as:

<dllmap dll="python27.dll" target="libpython2.7.dylib" os="osx" />
<dllmap dll="python27" target="libpython2.7.so" os="linux" />

after modifying lib/python2.7/site-packages/Python.Runtime.dll.config using the previous convention then "import clr" works. All my code that uses pythonnet in Windows works with no issues in OSX. I'm attaching the modified Python.Runtime.dll.config. I do not know if other python installations in OSX have a different extension other than .dylib. AFAIR, Canopy uses also dylib, which is the standard for OSX dynamic libraries.

Regards

Sam
Python.Runtime.dll.config.zip

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions