No such file or directory: 'openmc'

I have openmc running properly on Linux. However, I am trying to install it on a mac.

I have on my bashrc

~/.bashrc:
export PATH=$PATH:/opt/openmc_install/bin/

and,

echo $PATH

/Volumes/mac/nuclear/my_mcnp/MCNP_CODE/bin:/Users/felipenovais/opt/anaconda3/bin:/Users/felipenovais/opt/anaconda3/condabin:/Volumes/mac/nuclear/my_mcnp/MCNP_CODE/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin**:/opt/openmc_install/bin/**

I do not get an error when I import openmc, but I do get an error when I model.run()

Any idea why?
Thanks

Doesn’t seem like the openmc executable is actually showing up on your PATH. Some things to try:

  • run which openmc from a terminal
  • run import os; print(os.environ['PATH']) from Python

That is what I’ve got:

(openmc-env) Felipes-MacBook-Pro:UW Files felipenovais$ which openmc
/opt/openmc_install/bin/openmc
>>> import os
>>> print(os.environ['PATH'])
/Volumes/mac/nuclear/my_mcnp/MCNP_CODE/bin:/Volumes/mac/nuclear/my_mcnp/MCNP_CODE/bin:/Users/felipenovais/opt/anaconda3/envs/openmc-env/bin:/Users/felipenovais/opt/anaconda3/condabin:/Volumes/mac/nuclear/my_mcnp/MCNP_CODE/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/opt/openmc_install/bin/opt/openmc_install/bin:/opt/openmc_install/bin:/opt/openmc_install/bin


That’s strange — it looks like the right directory is on your PATH, so I’m not sure why the call through subprocess is failing. I’m not a mac user myself – any mac users have ideas?

Solved now. I tried to reinstall several times and this issue happened every time I defined -DCMAKE_INSTALL_PREFIX in CMake. Without defining it, it installed the executable on the default /usr/local/bin and it now works.

I faced that issue today, and the reasone as you provoke the cmke file with sudo, or su privilliage on the enveronment,

all you need is to release the lock on the CMAKFILES at the build director in openmc source file!!!

chmod a+x /Users/openmc/build/CMAKEFILE