Installing Python Extensions

Hi!

I’m having trouble installing a python extension. I’ve tried PIP installing to both the following directories and they install correctly, the files are there, but Rhino’s Python does not want to import the library:

pip install --target=/Applications/RhinoWIP.app/Contents/Resources/ManagedPlugIns/RhinoDLR_Python.rhp/Lib/site-packages simplecoremidi

pip install --target=/Applications/RhinoWIP.app/Contents/Resources/ManagedPlugIns/RhinoDLR_Python.rhp/Lib simplecoremidi

Rhino gives me the following error:

Message: cannot import _simplecoremidi from simplecoremidi

Traceback:
line 1, in , "/Applications/RhinoWIP.app/Contents/Resources/ManagedPlugIns/RhinoDLR_Python.rhp/Lib/simplecoremidi/core.py"
line 1, in , "/Applications/RhinoWIP.app/Contents/Resources/ManagedPlugIns/RhinoDLR_Python.rhp/Lib/simplecoremidi/init.py"
line 1, in , “/Users/Alex/Downloads/MIDI Research/test.py”

Any help would be greatly appreciated.

I’m hoping Steve Baer can help. I’m starting to think that this module is meant for Python 2.7 and it won’t work with Rhino’s Iron Python.

I also tried this:

pip install --install-option="–prefix=/Applications/RhinoWIP.app/Contents/Resources/ManagedPlugIns/RhinoDLR_Python.rhp/Lib/site-packages" simplecoremidi

Hi,

Are you using the Atom editor? If so you can type ctr+option+s to configure the path.

But that Python library probably wraps native code so it wouldn’t work in IronPython anyway.

Alain

Hi Alain,

Thanks for your response. Yes I am using Atom thanks to Steve’s recommendation. I’ll try the ctr+option+s to configure the path.

Hmm, that Library says that it runs on Python 2.7, I was assuming that it would work on Rhino’s Iron Python. I got it to work yesterday on Maya’s python by simply copy pasting it into the correct directory. I was just a few .PY files.

Here is the link to the package. It’s pretty simple, but maybe you’re right, it’s wrapping something:

https://pypi.python.org/pypi/simplecoremidi/0.2.1

Hi Alain,

I’m revising this one after a summer break…

I added the directory to Atom with ctr+option+s but that didn’t help. The module has 2 versions. 1 is for Python 2.7 and the other is 3.0. Neither work. I’m stumped. This is the error:

Message: cannot import _simplecoremidi from simplecoremidi

Traceback:
line 1, in , “/Applications/RhinoWIP.app/Contents/Resources/ManagedPlugIns/RhinoDLR_Python.rhp/Lib/simplecoremidi/core.py”
line 1, in , “/Applications/RhinoWIP.app/Contents/Resources/ManagedPlugIns/RhinoDLR_Python.rhp/Lib/simplecoremidi/init.py”
line 1, in , “/Users/Alex/Downloads/Simple Core Midi - OSX/simplecoremidi-master/simplecoremidi/examples/play_a_scale.py”

Is it because the module wraps a C code perhaps? Any help would be greatly appreciated.