Running EnergyPlus Simulation on Linux

Hi everyone!

I’m trying to run an Energy Plus simulation on a Linux server where I’m not an administrator and can only install software in my personal folder. For this reason, energy plus is not installed in the usual place, but in my personal folder on the server.

I specified the path to Energy Plus in the code, however, for some reason energyplus_idf_version() prompts None


After a lot of trial and error I decided to try to modify the energyplus_path.setter in the library and manually put the necessary path to EnergyPlus, which brought me to a new error.


The same code works fine on Windows. It is the first time I am working with Linux, so it is possible that I did not install EnergyPlus correctly, I tried to reinstall it, which did not help.

Would appreciate any help and ideas!
Thank you!

@ArtMouser

This sounds like a system path issue to me. I don’t think the EnergyPlus or Python libraries you’re using can use the full path for their internal methods, so despite hardcoding the full path to your EP folder and .exe there will still be path conflicts when various dependencies are called. If so, I’m not certain if the issue is with your python path, (linux) path, or both. I would just try all options and see if any works.

For Ubuntu, (not sure about other Linux distros), you can add your custom directory to the path with the following terminal command:

export PATH="$HOME/verkhovskiy/EnergyPlus-22-1-0:$PATH"

You have to run that command everytime you start your bash session, or you can just add that line to your .bashrc file for your custom EP folder to be permanently recognized.

To add EP to your system path, add the following to your python script:

import sys
ep_path =  "/home/verkhovskiy/EnergyPlus-22-1-0" 
if ep_path is not in sys.path:
     sys.path.insert(0, ep_path) 

And I think you can just add it permanently by adding export PYTHONPATH="$HOME/verkhovskiy/EnergyPlus-22-1-0:$PYTHONPATH" to your .bashrc file.
Edit: Removed, since this just confuses matters. Just sys.path will work fine.

Hi, @SaeranVasanthakumar !
Thank you very much for your reply!

I tried everything you suggested, however unfortunately I get the same errors, nothing has changed.


There’s a typo (copied from my original instructions) that is unintentionally replacing your entire PYTHONPATH with $PATH.

However, I think you should just delete the entire PYTHONPATH line from your .bashrc. Even if it was working, it’s doing the same thing as your python script, so you don’t need it.

Also, did you check if the paths are actually in sys.path and $PATH? When the .bashrc is modified, you’ll also need to run the source ~.bashrc to ensure your bash environment gets the changes.

Thank you, noted!

Yes, I believe the paths are in $PATH. Even twice after I ran source ~.bashrc.

Hmm… I think solving it requires more knowledge on this then I have. I would suggest taking a look at Docker images for HB-Energy or EnergyPlus, they may have this problem solved.

Ok, I’ll take a look.
Thank you very much for your input anyway!

Hey @ArtMouser ,

Sorry for the late response. The code that you have there should work without the need to overwrite the setter of the energyplus_path.

Did you try checking to be sure that your EnergyPlus executable is accessible with the privileges you have on the machine? What happens when you try to run the following command on the machine:

/home/verkhovskiy/EnergyPlus-22-1-0/energyplus --version

If you’re not able to get the EnergyPlus version from that command, then you probably can’t run the E+ executable with your current privleges.

Hey @chris ,

Thank you for your reply.
I contacted the server administrators and EnergyPlus support and it turned out that EnergyPlus is not compatible with the OS used on this machine (CentOS Linux 7).
Do you think there might be some walkaround in this situation?

Run it through Docker? Then you can also use one of the existing Docker images for EP/OpenStudio/HB-Energy, and not worry about setting up your environment.

I considered this option, but when I asked to install docker on the server, the admins told me the machine “doesn’t work with docker” for some reason, but I’ll check with them again. Thank you @SaeranVasanthakumar !

Hmm, I’m not familiar with CentOS Linux 7, but it seems very restrictive. Maybe you can ask your admins if there are any compatible VMs or remote servers you can use with CentOS. If that doesn’t work… the only other thing I can think of is to manually set up a separate server with a compatible OS (i.e. Ubuntu) and use some method (SSH, your own API) to send/receive EP data.

That being said, I don’t have a lot of experience with this kind of devops work, so there probably is a better solution I’m missing!

1 Like

I apologize for mixing separate questions within the same topic, but I am writing here as a continuation of the issue. As an alternative, I was proposed to use a cluster which runs computations on GPU nodes and has docker installed there (instead of CPU cluster I was currently trying to use). Is it possible to effectively run EP simulations through Docker on GPU-based cluster?

I don’t know what you mean by “GPU-based cluster” beyond the fact that it sounds like the machines have good GPUs but, as long as you have Docker and it is set up correctly, then you can run Docker images.