Cannot remove old ladybug, new ladybug not running due to Python error: "no module named os"

Hi there,

I am having an issue with getting the new version of ladybug to run on my Windows 7 laptop. The main component gives an error saying the os module cannot be found. I have tried the fix suggested in this thread but it did not solve the problem. I have an installed version of Python 3 as well as a Python 2.7 on my machine.

I am wondering if anyone knows what could be the cause of this problem.

Hi @PirouzNourian,

Rhino doesn’t use Python installation on your machine but it uses the IronPython installation that comes with Rhino itself.

What happens when you try to import os in a GHPython component? If it gives you an ImportError then there is something wrong with the Rhino installation. You can also try sys.path to see if the path to IronPython is included.

import sys
print('\n'.join(sys.path))

Hi Mostafa,

Thanks for your response. I have also tried a fix with IronPython:

After I ran the two diagnostics lines (that you have suggested) I got this error message:

Runtime error (ImportException): No module named string
Traceback:
line 7, in , “D:\pnourian\Application data\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\utility.py”
line 8, in , “D:\pnourian\Application data\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\application.py”
line 8, in , “D:\pnourian\Application data\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript_init_.py”
line 2, in , “D:\pnourian\Application data\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscriptsyntax.py”
line 51, in script

Thank you for testing. Based on the error message I think you should post this to McNeel forum as it is an IronPython installation issue. Once you can import the modules successfully Ladybug should work fine. Also see this which might be the case if you have Dynamo installed which installs its own version of IronPython.

Thanks a lot!, yes makes sense. I have probably messed up something with IronPython while trying to get SciPy to work in Rhino.

Hi,
I can share my experience with this.
Yesterday i also installed Rhino 6 and LB/HB were all red.
Related to the discussion @mostapha mentioned, i checked my ironpython version. It was 2.7.3 (i think).
I uninstalled it and it all works now. I’m planning to install IP2.7.7 and see.
Didn’t check what happens with Dynamo, though.
-A.

1 Like

Hi Abraham,

Thanks for sharing your experience. I just reinstalled IronPython but still get the following errors from the main component of Ladybug:

Runtime error (ImportException): No module named string
Traceback:
line 7, in , "D:\pnourian\Application data\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\utility.py"
line 8, in , "D:\pnourian\Application data\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\application.py"
line 8, in , "D:\pnourian\Application data\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript_init_.py"
line 2, in , "D:\pnourian\Application data\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscriptsyntax.py"
line 51, in script