RenderMan: ImportError: dynamic module does not define module export function (PyInit_librenderman)
Thanks for making this!
I installed boost-python, successfully built the XCode project, renamed the built file to remove the “.dylib”, but when I run the “Does It Work?” check, I get…
$ python
Python 3.5.3 | packaged by conda-forge | (default, Feb 10 2017, 07:09:50)
[GCC 4.2.1 Compatible Apple LLVM 7.3.0 (clang-703.0.31)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import librenderman as rm
JUCE v5.2.0
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: dynamic module does not define module export function (PyInit_librenderman)
>>>
Any suggestions on how one might fix this?
In the current directory I have…
$ ls
librenderman.so
Running Mac OS X 10.13.3 (High Sierra), XCode 9.2, Python 3.5.2 (Anaconda)
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 16 (8 by maintainers)
Just as a follow-up: Whether on Linux or Mac, to get it to work with Anaconda python, you just need to give the build system the locations of the Anaconda libraries.
So, on Mac, in the Projucer, in Exporters > Xcode(Mac), I have the following lines:
Header search paths: /usr/local/include /Users/shawley/anaconda/envs/py36/include /Users/shawley/anaconda/pkgs/python-3.6.0-2/include/python3.6m/
Extra library search paths: /usr/local/lib /Users/shawley/anaconda/envs/py36/lib
Great thanks for this - I’ll make sure this is all automated in the coming months 😃
No worries at all 😃
As a note - I am currently knee-deep amongst papers and dodgy code for my thesis, but I am nearly finished!
After I am done, I will be renovating this library (about 40 days) for a creative deep learning course I’ll be instructing, so that all of this can be abstracted away to a simple pip install!
I tried your solution @fedden but ran into a few issues. I am using MacOS 10.13 and Python 3.6 installed via Homebrew. I did eventually get it working by following the following steps (All commands are given for my exact installation, so some modification of commands may be required):
On terminal:
/usr/local/include
pointing to the python3.x headers that Brew has installed. In my case:/usr/local/lib
folder. Cannot add directly as “python3.x” is being used for site-packages. There is probably a more elegant solution but this is what I came up with:Now, inside Projucer: 5. Set the “Extra Linker Flags” in Exporters → Xcode(MacOS) to:
6.2 “Extra library search paths”:
Hit save in Projucer, and then Build inside Xcode (⌘B), and hopefully the build will succeed. If not, clean (⌘⇧K) and build again. This is the most system-independent solution I could come up with so far.