I just installed butterfly freshly on a new computer from scratch.
I got the following error on the createCaseFromTunnel component after opening the outdoor airflow example file:
1. Solution exception:
Failed to import butterfly:
Cannot import name xyzToPoint
This happened after I did the following to solve the blockMesh error as reported here and make sure butterfly runs correctly:
- run virtualbox as admin and power off the default machine
- run OpenFOAM_Start as admin, and keep it open and standby
updated butterfly using the Butterfly (BF::BF) component as suggested in this link
change the version number to v1706+ as suggested in this link
- open Rhino as admin
I’m unable to find posts reporting the same issue, and I thought I’ve tried everything I learned from previous failed butterfly installations. So, I’d appreciate your kind advice on how to debug this issue.
… I tried the following, and the problem as reported above is still not solved:
reinstalled butterfly using the original installer file in the installation package
changed the OpenFOAM version number to v1706+ in the version.py file
there are 43 files in the folder C:\Users#USERNAME\AppData\Roaming\McNeel\Rhinoceros\5.0\scripts\butterfly
now open the outdoor airflow example file, and there is no component with the Failed to import butterfly: red error. But the blockMesh component is not working and is still reporting OF version related error:
- Solution exception:Failed to find container id.Do you have the OpenFOAM container running?
You can initiate OpenFOAM container by running start_OF.bat:
C:\Program Files (x86)\ESI\OpenFOAM\1706\Windows\Scripts\start_OF.bat
so, update butterfly using the Butterfly (BF::BF) component, and there is a problem, so delete the three butterfly related folder in C:\Users#USERNAME\AppData\Roaming\McNeel\Rhinoceros\5.0\scripts as discussed here
update again, and it works.
now there are 44 files in the folder C:\Users#USERNAME\AppData\Roaming\McNeel\Rhinoceros\5.0\scripts\butterfly, and the newly added file is gradingutil.py
run Rhino as admin again, now the Failed to import butterfly: red error show up for three of the major butterfly component.
So, it seems the butterfly update somehow created some issues here …
appreciate your kind advice on how to solve this issue.
Thanks for reporting. It’s hard for me to know why exactly this is happening since I updated only 3 days ago in my home computer with just updating the components and restarting rhino/gh. I did not close the virtual box or changed the name of the version, if that’s of any use. Everything worked out of the box.
Is it easy to do a fresh reinstall, maybe deleting all folders (new ones and old if they are there)? I’m sorry I can’t provide more help.
Noted with thanks, @TheodorosGalanos. Let me try to do a thorough re-installation of Butterfly as suggested.
Hi @TheodorosGalanos, the “Failed to import butterfly” error remained after I did a complete re-installation of butterfly and restarted the virtual machine, OpenFOAM and Rhino as admin.
… still not sure what is causing this issue.
I manage to solve the issue by replacing the following folders and files with the ones copied from another computer which installed butterfly previously and running OpenFOAM correctly:
- all 59 butterfly ghuser objects in C:\Users\USERNAME\AppData\Roaming\Grasshopper\UserObjects folder
OpenFOAM now runs correctly through Butterfly.
However, updating Butterfly will cause the problem as reported above.
I noticed that the latest version.py file has been changed as compared to the “old” one I’m using now as shown below (old one is shown on the left, and the latest one on the right). I’m not sure if these changes in variable names are causing the problem here. Appreciate your kind advice.
version_old.py (2.1 KB)
version_new.py (2.1 KB)
Butterfly has been through several updates recently which will break old sample files. It was expected but I should have provided a better support to let people know about it:
In any case what you have done should solve the problem. Once you have replaced all the files and userobjects use Ladybug’s update file component to update the files. That will replace the components with the most recent ones which should have
from butterfly_grasshopper.geometry import xyz_to_point instead of
Noted with thanks, @mostapha. Will try the suggestion later.
Thank you and the LB+HB+BF development team for all your hard work and generous help. Wish you all and your families a happy holiday season and a prosperous new year ahead.
I am having a similar issue, but with version 0.0.0.5 of Butterfly. I have deleted and reinstalled multiple times now, but still seem to get errors that either read: “1. Solution exception:
Failed to import butterfly:
Can’t find butterfly in sys.path.
You need to install butterfly to use butterfly-grasshopper.
You can download butterfly from
or “21. Solution exception:Failed to import butterfly:
Set your installation flavor in confing.yml.”.
I have blueCFD-Core-2020 installed on my computer (which I believe automatically installs OpenFoam?)Butterfly_err.gh (9.6 KB) . Perhaps I should try an earlier version?
Hey, I suggest you use Bluecfd2017.2
Ok thanks I will try this.
i’m having a problem with butterfly on rhino 7
- Solution exception:
Failed to import butterfly:
No module named butterfly_grasshopper.geometry
please help, i have a deadline
with all do respect ,
I just had the same problem. On the second try I made sure to “unblock” the zip folder before extracting the files from food4rhino and to run the installer while having Rhino in Admin mode.
Hopefully that works for you too
hey i got this same issue with rhino 8 now, help