# Cross Section File not specified

**URL:** <https://openmc.discourse.group/t/cross-section-file-not-specified/4242>\
**Category:** User Support\
**Created:** [May 7, 2024, 10:12am UTC](https://openmc.discourse.group/t/cross-section-file-not-specified/4242 "2024-05-07T10:12:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![silent.storm](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@silent.storm](https://openmc.discourse.group/u/silent.storm)\
**Post date:** [May 7, 2024, 10:12am UTC](https://openmc.discourse.group/t/cross-section-file-not-specified/4242/1 "2024-05-07T10:12:57Z")

</div>

I have been trying to replicate the Exercise document “Modeling a Pin-Cell” from OpenMC examples. I have followd all the steps but now facing this error. How to solve this issue?

**RuntimeError: 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.**

There are other solutions regarding this topic but I am not sure how to set OPENMC\_CROSS\_SECTIONS to be an absolute path.

---

<div class="post-metadata">

**Author:** ![yrrepy](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/yrrepy/32/2365_2.png) [@yrrepy](https://openmc.discourse.group/u/yrrepy)\
**Post date:** [May 7, 2024, 4:42pm UTC](https://openmc.discourse.group/t/cross-section-file-not-specified/4242/2 "2024-05-07T16:42:36Z")

</div>

Either of the following will work:

- Solution 1:

Execute the following in your terminal or add to your ~/.bashrc  
`export OPENMC_CROSS_SECTIONS= /home/silentstorm/path/to/NuclearData/OpenMC/endfb80_hdf5/cross_sections.xml`

- Solution 2

Add the following to materials.xml:  
`<cross_sections>/home/silentstorm/path/to/NuclearData/OpenMC/endfb80_hdf5/cross_sections.xml</cross_sections>`

There’s probably a solution 3 where you can add it to the Python notebook.

---

<div class="post-metadata">

**Author:** ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)\
**Post date:** [May 8, 2024, 4:25pm UTC](https://openmc.discourse.group/t/cross-section-file-not-specified/4242/3 "2024-05-08T16:25:44Z")

</div>

I would also recommend looking through the user’s guide section on [data configuration](https://docs.openmc.org/en/stable/usersguide/data.html). In addition to the methods mentioned by @yrrepy, you can also use a runtime configuration, `openmc.config`, from Python.
