For example I need natsort for one of my Python scripts in Rhino: natsort · PyPI
Do I have to first install Python on my system then use pip?
Or is there any other way to do it using Rhino?
For example I need natsort for one of my Python scripts in Rhino: natsort · PyPI
Do I have to first install Python on my system then use pip?
Or is there any other way to do it using Rhino?
Does this guide help?
If it does not, we can try to determine how to get it to work.
Read the instructions you were given a little further down. Pay attention to the part where it says:
# r: numpy
yes,
you are right
It cannot find it in the path. Where is Numpy installed on the computer?
What search paths are set in the editor?
There is a box icon in the editor toolbar that will allow the pre-heating loading if the packages. See if that works?
As @James_Parrott was mentioning I didn’t Copy-Paste # r: numpy
Works like a charm.
Better would be to have a Package Manager for the Script Editor, to add and remove packages.
There is this Packages tool to reach into packages and set them up in the script with the requirements:
Also, there are ways to add Libraries to a local folder: Local Python folders search
Ok, I see, another way to install packages is by clicking the box and specifying the source.
Package Manager should also have a list of already installed packages though…
With uninstall option.
Just type in natsort
. No need to specify the pypi.org
path
@eirannejad , I installed the latest Rhino update and afterwards the natsort library cannot be found. I had to install it again. This looks like a bug, no?
Sometimes a new Rhino re-initializes the Python 3 environment to apply updates. Make sure to include the script requirements at the top e.g. # r: natsort
so it can be installed automatically if missing.
ok, If this is good for Rhino I will comply