Why do I get this message: Failed to import X: No module named X

Hi again,
I don’t see where to open new topics in this beta test site, so i’m writing here what i’ve found so far.
Started to test the LB_Windrose example. It is not running.
The DownloadEPW complains about:

  1. Solution exception:
    Failed to import ladybug:
    No module named ladybug.futil

Not sure if this affects the following components which are also failing with as follows:
ImportEPW (fails also when i connect a string with the EPW path file):

  1. Solution exception:
    Failed to import ladybug:
    No module named ladybug.epw

and the WindRose:

  1. Solution exception:
    Failed to import ladybug:
    No module named ladybug.datacollection

I believe something is missing yet in my machine, so i’ll wait for your words of wisdom before going on.
Now i’m sure about this since any component i put in the canvas is red. Is like the LB_LB equivalent of the legacy is missing for this new version.
Tx,
-A.

You are getting this error because the Grasshopper components have been unable to load the core libraries.

The most likely reason for this on Windows is that you failed to run step 4. of the Windows installation instructions with Rhino closed. Make sure Rhino is closed and then double-click that .bat file.

It may be worth noting that the primary reason for step 4 is to workaround an issue that McNeel has acknowledged as a bug. So, hopefully, they fix it at some point.

Y E S !!!
You should use font 5000000 to be seen :grinning:
Tx. The files are running fine and F A S T!!! :rocket:

-A.

Also, the way that you post topics for the private beta test group is just by making sure that they are in the “Early Access” group.

I see now. How rusty i am … OMG.

It’s all good. This is also my first time dealing with a private group. It never hurts to ask how it works.

Hi! I am encountering this same issue even though I made sure I did step 4 correctly. I noticed the username of the account I’m using on this computer has a space though. Is it possible that that could be causing the problem?

That shouldn’t cause this problem, @LanceMonfort . But the space might cause some other issues that we are currently trying to resolve. If you want to make sure that you ran the last installation step correctly with Rhino closed, you should open the file at this location in a text editor:

C:\Users\[USERNAME]\AppData\Roaming\McNeel\Rhinoceros\6.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings

If it looks something like this, then you have done the last step correctly and we can try debugging some other things:

Thank you for the response, @chris. I opened that file and mine looks like this:

Screenshot 2020-10-13 121203

Can I just edit the text to match what you posted or should I do something else to fix the issue? What do you think? Thanks!

Hey @LanceMonfort,

That screenshot really seems to suggest that set_python_path.bat wasn’t run with Rhino closed. So you can either run the set_python_path.bat and you will see that the correct text automatically gets added to that file. Or you can manually do it if you want. Just make sure that Rhino is closed throughout the whole process.

Ah wait. You are right that the white space is the issue. I forgot that the command that’s being run in the .bat file isn’t formatted correctly to handle white spaces. If you add quotation marks around these parts of the .bat file, that will get it to run correctly:

Sorry for the confusion here and I will add a fix into the intsaller.gh now.

Thanks for catching and reporting this, @LanceMonfort . I just updated the link on Food4Rhino to make sure the installer.gh can handle white spaces in the file path. So you saved many others from experiencing the same issue.

Note that the Food4Rhino update was only a change in the installer.gh file and none of the components that are a part of the plugin have been affected.

No worries and thank you as well, @chris! Just tried re-installing it and it works perfectly now. Thanks again!

1 Like

Hi Chis. I have the same problem. I check that the set_python_path.bat had quotation marks and ran it. When I drop a LB 1.1.0 componet to the canvas it becomes red and shows me “1. Solution exception:
Failed to import ladybug: No module named ladybug.futil”

My User directory name has an space in it.

Hellow, Chris. I have the same situation. I am sure that I double-clicked that .bat file with rhino closed, but my lb could not run. :sob:
I didn’t install my rhino on disk C. Could this have caused that malfunction?
Here is my screenshot.

1 Like

Hi there,

I’m unfortunately having the same problem. Just like @potato, the set_python_path application tells me “Congratulations! Setting the search path in the following file was succesful:” without then naming a file location (also see the screenshot attached).
I tried reinstallation, running it as administrator, but nothing helped.

Thank you for your help and the great work at LB in general!

Best,
Julian

Interestingly, it now worked with my newly installed Rhino 7. However, the python library is still not connected to Rhino 6.
Which raises the question if it is even possible to have LB 1.0.1 installed for both versions at the same time and how you’d tell the “set_python_path” tool to connect to R6?

Best,
Julian

1 Like

Just saw this thread, which answers most of the questions:

sorry for not seeing it first and thank you!

1 Like

Thanks for sharing the thread! This helped me a lot.
And thanks for all those who have contributed to solving this problem!

Glad that everyone seems to have gotten things working here. I also wanted to post the manual workaround which will always work on any Windows machine and for either Rhino 6 or 7 (regardless of whether you have admin privileges, a username, etc.):

As you can see it’s a lot of steps so, if you can get things to run just by re-running the .bat file, then that’s probably preferred. But, with the manual process above, anyone will be able to get things to work.