But today, after attempting a package install that went wrong (multiprocessing). The original script doesnt work anymore.
The script uses numpy, and the error I get is:
Traceback (most recent call last):
File "rhinocode:///grasshopper/1/2ce434ae-a001-4192-9330-7f332b6c3991/ec5f1a54-5332-4f22-a0dd-93a139724fa1", line 18, in <module>
File "C:\Users\name\.rhinocode\py39-rh8\lib\site-packages\numpy\__init__.py", line 211, in <module>
from . import lib
File "C:\Users\name\.rhinocode\py39-rh8\lib\site-packages\numpy\lib\__init__.py", line 33, in <module>
from . import _polynomial_impl
File "C:\Users\name\.rhinocode\py39-rh8\lib\site-packages\numpy\lib\_polynomial_impl.py", line 19, in <module>
from numpy.exceptions import RankWarning
ImportError: cannot import name 'RankWarning' from 'numpy.exceptions' (C:\Program Files\ladybug_tools\python\Lib\site-packages\numpy\exceptions.py)
So it does look like it is trying to use Numpy, from the LBT installation.
FYI the header of the file is:
#! python 3
# venv: site-packages
# r: numpy
I’ve tried restarting, but it seems like my GH/Python setup is corrupted.
I’d get rid of any multiprocessing remnants (and everything else) and force a reinstall of numpy (and everything else).
Do: cd %USERPROFILE%\.rhinocode\py39-rh8\site-envs then cd into default- whatever it’s called. Delete the directories starting with numpy to uninstall them.
Alternatively without deleting anything, you could try setting up a venv, # env: my_venv I believe, and install all the deps into that instead. But I don’t know if the globally installed packages are still importable from Rhino/Grasshopper’s type of venvs.