AssertionError: No URBANopt Gemfile was found in dragonfly_energy.config.folders

Hello. I am leaving a question because I am getting an error while using the dragonfly module.

from dragonfly_energy.run import prepare_urbanopt_folder
An error occurred when executing the prepare_urbanopt_folder function.

The following error appeared.
AssertionError: No URBANopt Gemfile was found in dragonfly_energy.config.folders.

What should I do to solve the problem?

Hello!
I would like to bump this topic up. I have the same error. I tried to use the core libraries (ladybug, honeybee and dragonfly) to set up the files needed to run an URBANopt simulation. I know it is related to the config json file (located in the dragonfly_energy package). My config file is empty and looks like this:
{
comment”: “Add full paths to files (eg.C:/Urbanopt_test/Honeybee.rb).”,
“mapper_path”: “”,
“urbanopt_gemfile_path”: “”,
“urbanopt_cli_path”: “”,
“urbanopt_env_path”: “”,
“reopt_assumptions_path”: “”
}
Does somebody have an example of how to define this config file?

Thanks a lot in advance,

Have a great evening,

Benoit

Hi @bdelcroix ,

I think it’s possible to get this error if you have some very old version of the honeybee-openstudio gem or dragonfly-energy on your system. How did you install Ladybug Tools?

Are you using the library from a script editor like @mooyeol.oh seems to be doing in the original post?
If so, did you make sure that all of your core libraries are up-to-date by using

pip install lbt-dragonfly -U

… and did you also install ladybug tools on your system so that you can get some of the non-python dependencies that are needed to run URBANopt?

Hi @chris,
Thanks for the quick answer. I have installed recently the ladybug tools (core libraries including lbt-ladybug, lbt-honeybee and ladybug-dragonfly). However, I updated this morning the ladybug-dragonfly package. But I still get the same error given by @mooyeol.oh in the first message. Maybe I can explain my whole process:
Step 1: I installed URBANopt (version 0.9.3). I saw that a more recent version (0.10.0) is available. Can it be the source of the problem?
Step 2: I created a new conda environment using Miniconda where I installed the 3 core libraries (lbt-ladybug, lbt-honeybee and lbt-dragonfly). I found it weird that the config file (shown in my previous message) is empty. It is also the case in the GitHub repo (https://github.com/ladybug-tools/dragonfly-energy/blob/master/dragonfly_energy/config.json), so probably normal.
Step 3: I use these ladybug libraries in a Python script (editor: Spyder). So I do not use Grasshopper. The error mentioned previously appear when I use the function “dragonfly_energy.run.prepare_urbanopt_folder()”. Initially, I was thinking that since the URBANopt gemfile was not found, it was because it was not located correctly in a config file.
@chris, do you have an idea about what would be the problem? Or @mooyeol.oh, did you find a solution?
Thanks a lot!

Hello @chris,
Well, I think I have a clue of solution. It seems to me that it is related to the absence of the honeybee.rb file that I cannot find in my installations (python libraries or URBANopt) but well in the Github repo (GitHub - ladybug-tools/honeybee-openstudio-gem: 🐝 Library and measures for translating between Honeybee JSON schema and OpenStudio Model schema (OSM)). So, I suppose I will clone locally this repo and I will explicitly define the path in my python script to the honeybee.rb file. Or is there a better way to do it? Otherwise, I will try it tomorrow.
Thanks and have a great evening!

Hi @bdelcroix ,

Thanks for the clarification. Yes, this is because you only have the Python libraries and URBANopt installation on your machine but you need a couple more dependencies to actually use dragonfly to run URBANopt. Specifically, there’s a Ruby gem that is needed for URBANopt and runs under the hood to translate the Dragonfly models into OpenStudio format when the URBANopt CLI runs.

To get all of the dependencies that you need, you can just run either the free Pollination single-click installer (you just ahve to make a pollination account) or you could go through the process of installing via the Food4Rhino Grasshopper script. If you don’t have Rhino installed, the single-click installer will probably be the better route.

Let me know if you encounter any issues in setting this up.

1 Like

Also, if you are using the latest lbt-dragonfly, you should use URBANopt CLI 0.10.0.

You’ll see this in the Ladybug Tools compatibility matrix:

1 Like

Hello @chris
Great! There is no more error. I have run the function “dragonfly_energy.run.prepare_urbanopt_folder()” without issues except the one related to the max length of path (windows issue that I found in another discussion and then found a solution). Thanks! Since I’m beginning with the tool, I think I will come back with other issues :stuck_out_tongue: But I’m happy to see that the forum is pretty active.
Thanks again!
Bye!

1 Like