问题描述
我通过conda在macOS Catalina上使用openMC安装。作为教程here。 此外,我使用Jupyter笔记本来编写代码。 然后,我尝试了示例>> post_procesing here 直到我没有问题
ln[9]: plot = openmc.Plot.from_geometry(geometry)
plot.pixels = (250,250)
plot.to_ipython_image()
我收到此错误
---------------------------------------------------------------------------
CalledProcessError Traceback (most recent call last)
<ipython-input-10-4c671a78cd00> in <module>
1 plot = openmc.Plot.from_geometry(geometry)
2 plot.pixels = (250,250)
----> 3 plot.to_ipython_image()
~/opt/miniconda3/envs/openmc-env/lib/python3.8/site-packages/openmc/plots.py in to_ipython_image(self,openmc_exec,cwd,convert_exec)
703
704 # Run OpenMC in geometry plotting mode
--> 705 openmc.plot_geometry(False,cwd)
706
707 # Convert to .png
~/opt/miniconda3/envs/openmc-env/lib/python3.8/site-packages/openmc/executor.py in plot_geometry(output,cwd)
48
49 """
---> 50 _run([openmc_exec,'-p'],output,cwd)
51
52
~/opt/miniconda3/envs/openmc-env/lib/python3.8/site-packages/openmc/executor.py in _run(args,cwd)
26 # Raise an exception if return status is non-zero
27 if p.returncode != 0:
---> 28 raise subprocess.CalledProcessError(p.returncode,' '.join(args),29 ''.join(lines))
30
CalledProcessError: Command 'openmc -p' returned non-zero exit status 255.
所以我尝试重新安装很多次,但无法正常工作,请帮助我。非常感谢。
解决方法
我认为您需要通过终端在您的操作系统上定义环境变量 OPENMC_CROSS_SECTIONS
。
它在 linux 上对我有用,但是,我没有使用 MACos 的经验。