OpenMC cross_section.xml problem

Hi there,

I’m new in OpenMC and need some help.
I using openMC on macOS Catalina install via conda. As tutorial here
Furthermore I use Jupyter notebook for writing code. Then I tried example >> post_procesing here I have no issue until

ln[9]: plot = openmc.Plot.from_geometry(geometry)
       plot.pixels = (250, 250)
       plot.to_ipython_image()

I got this error

 Reading settings XML file...
 ERROR: No cross_sections.xml file was specified in materials.xml or in the
        OPENMC_CROSS_SECTIONS environment variable. OpenMC needs such a file to
        identify where to find data libraries. Please consult the user's guide
        at https://docs.openmc.org/ for information on how to set up data
        libraries.

But, I already download the file Official Data Libraries here I download ENDF/B-VII.1 and put it in /Users/saksorn/opt/data/endf
Next I set a PATH like this by using vim .zprofile in terminal
Screen Shot 2563-08-15 at 23.53.12
then I try again but it’s have the same error.

Moreover when I install OpenMC via conda it dosen’t have a OpenMC in home directory.
It install here
/Users/saksorn/opt/miniconda3/envs/openmc-env/lib
I don’t know is that will effect the program or not.

Thank you, saksorn.

OpenMC cross_section path variable

export OPENMC_CROSS_SECTIONS='/Users/saksorn/opt/data/endf/cross_sections.xml'
export OPENMC_CROSS_SECTIONS

It will not affect the program.

1 Like

It’s work fine!
Thank you so much, Pranto.

It’s will be the same in ubuntu right?

export OPENMC_CROSS_SECTIONS='/Users/saksorn/opt/data/endf/cross_sections.xml'
export OPENMC_CROSS_SECTIONS

Glad to hear it.

Yep. It will be the same also for ubuntu @huak95

1 Like

@Pranto Exactly where shall I type it? It didnot work for me when I typed them inside the openmc-env.

@Nilormi If you’re using bash, you can add OPENMC_CROSS_SECTIONS env variable in your .bashrc file. If you’re using zsh, then you should write them in your .zshrc file instead. Both of these files are typically located in your home directory. To know which shell are you using, use the following command:

echo $0

@Pranto Thank You. But I did resolve this issue already.

I am now trying to create geometry .