RH6: How to install Python module, Cluster?

I have cluster installed in python and see two folders in the site-packages folder there. But simply copying these folders into rhino’s site-packages folder does not seem to work.
What is the exact process for installing addition packages/modules?
I know some are not compatible with IronPython, some are for 3.x etc.

Is there something like pip for Rhino’s IronPython?

https://pypi.org/project/cluster/

Thank you!

Hi @jonahhawk, you might try to add the search path to the folder from Tools > Options of the python editor. If you then try to import your cluster module, do you get an error ?

_
c.

Thanks for the reply. Yes, I had added the explicit path to the folder set in options.

Runtime error (ValueErrorException): Attempted relative import in non-package

Traceback:
line 20, in , “C:\Program Files\Rhino 6\Plug-ins\IronPython\Lib\site-packages\cluster\cluster.py”
line 12, in script

Line 12 in the script is simply:
import cluster
Line 20, in cluster.py is:
from .util import fullyflatten

util.py is in the same folder as cluster.py

If we step back from cluster, specifically, what is the process for adding non-common python modules? Am I right to add them in the site-packages folder of RH6 above? Or can I point a search path the site-packages folder of Python 2.7.5? What is the best practice here?

Removing the . in .util removed the error altogether.

I’d still like to know that I am on the right track for adding modules to rhino…

Edit: It is still not fully functional. Only the methods in the same folder show up in the python editor.
Running their examples does not work. Rhino does not search subfolders and does not find the other methods even if I’ve specified the file path.

https://pypi.org/project/cluster/

Hi @jonahhawk, have you looked for an __init__.py file and did you tried to add it’s folder to sys.path yet ? It could be that some are not compatible with IronPython.

_
c.

Yes, the init.py file is in the same root folder.

It feels so close to working… no errors but it is incomplete.
It would be great if there were a way to install modules in rhino python as easy as we can with pip in python. Or at least a list of tested and compatible modules somewhere on the web.

Thanks for the help.