Question-and-Answer Resource for the Building Energy Modeling Community
Get s tarted with the Help page
Ask Your Question

Revision history [back]

That's more of a Unix question than a specific OpenStudio one. But anyways, when you type openstudio (or any program without a full path), it will look for this executable, in order of preference

  • In the current folder
  • In your PATH variable

which openstudio will tell you where it found it. It's likely going to be at /usr/local/bin/openstudio and that is a symbolic link (or symlink). ls -la $(which openstudio) will tell you where it points to. Here are the result of the commands on my Ubuntu machine

$ openstudio --version
$ which openstudio
$ ls -la $(which openstudio)
lrwxrwxrwx 1 root root 53 juin   1 08:55 /usr/local/bin/openstudio -> /usr/local/openstudio-3.1.0/bin/openstudio

If you want to temporarily use another version, then specify the full path to the openstudio CLI. On mac it's going to be something like /Applications/openstudio-3.2.0/bin/openstudio

$ /usr/local/openstudio-3.1.0/bin/openstudio --version
$ /usr/local/openstudio-3.2.0/bin/openstudio --version

If you want to permanently change it, you just need to redo the symlink via sudo ln -sf <path/to/installed/openstudio> <destination>

$ sudo ln -sf /usr/local/openstudio-3.2.0/bin/openstudio /usr/local/bin/openstudio
$ ls -la $(which openstudio)
lrwxrwxrwx 1 root root 42 juil.  5 21:50 /usr/local/bin/openstudio -> /usr/local/openstudio-3.2.0/bin/openstudio
$ openstudio --version