# IsADirectoryError: \[Errno 21\] Is a directory: '/opt/endfb-vii.1-hdf5'

**URL:** <https://openmc.discourse.group/t/isadirectoryerror-errno-21-is-a-directory-opt-endfb-vii-1-hdf5/3259>\
**Category:** User Support\
**Created:** [August 3, 2023, 2:37pm UTC](https://openmc.discourse.group/t/isadirectoryerror-errno-21-is-a-directory-opt-endfb-vii-1-hdf5/3259 "2023-08-03T14:37:07Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ron](https://avatars.discourse-cdn.com/v4/letter/r/ecae2f/32.png) [@ron](https://openmc.discourse.group/u/ron)\
**Post date:** [August 3, 2023, 2:37pm UTC](https://openmc.discourse.group/t/isadirectoryerror-errno-21-is-a-directory-opt-endfb-vii-1-hdf5/3259/1 "2023-08-03T14:37:07Z")

</div>

To all

I am an experienced MCNP user, but I am new to the world of openmc and pyne.

I am using openmc on in a WSL2 Ubuntu environment.  
I have openmc installed in the same conda environment as PyNE.  
I do not have a DATAPATH statement in my .bashrc

I’m getting an error message: [Errno 21] Is a directory: ‘/opt/endfb-vii.1-hdf5’  
/opt/endfb-vii.1-hdf5 is indeed a directory, and it contains these files: cross\_sections.xml neutron photon wmp

I’ve looked at the [New User - Cross\_Section.XML issue](https://openmc.discourse.group/t/new-user-cross-section-xml-issue/629), and looked at the  
, and the associated response.  
I saw where the ACE data libraries can be down loaded.  
I looked at the OpenMC User’s guide. While I saw some references to openmc.config, I did not see anything about the configuration/contents of the file, or where it is stored. I do not have a copy of openmc.config in either my installation directory or my user directory.

Can someone please help?

Thanks.

Ron

I am using the following example in Jupyterlab:

%matplotlib inline  
import os  
from pprint import pprint  
import shutil  
import subprocess  
import urllib.request

import h5py  
import numpy as np  
import matplotlib.pyplot as plt  
import matplotlib.cm  
from matplotlib.patches import Rectangle

import openmc.data

I get this error:

* * *

IsADirectoryError Traceback (most recent call last)  
Cell In[1], line 14  
11 import matplotlib.cm  
12 from matplotlib.patches import Rectangle  
—\> 14 import openmc.data

File /opt/anaconda3/3.10/anaconda3/envs/openmc-env/lib/python3.10/site-packages/openmc/ **init**.py:35  
33 from openmc.tracks import \*  
34 from . import examples  
—\> 35 from .config import \*  
37 # Import a few names from the model module  
38 from openmc.model import rectangular\_prism, hexagonal\_prism, Model

File /opt/anaconda3/3.10/anaconda3/envs/openmc-env/lib/python3.10/site-packages/openmc/config.py:92  
87 config[‘chain\_file’] = chain\_file  
89 return config  
—\> 92 config = \_default\_config()

File /opt/anaconda3/3.10/anaconda3/envs/openmc-env/lib/python3.10/site-packages/openmc/config.py:81, in \_default\_config()  
75 chain\_file = os.environ.get(“OPENMC\_CHAIN\_FILE”)  
76 if (chain\_file is None and  
77 config.get(‘cross\_sections’) is not None and  
78 config[‘cross\_sections’].exists()  
79 ):  
80 # Check for depletion chain in cross\_sections.xml  
—\> 81 data = DataLibrary.from\_xml(config[‘cross\_sections’])  
82 for lib in reversed(data.libraries):  
83 if lib[‘type’] == ‘depletion\_chain’:

File /opt/anaconda3/3.10/anaconda3/envs/openmc-env/lib/python3.10/site-packages/openmc/data/library.py:149, in DataLibrary.from\_xml(cls, path)  
145 if path is None:  
146 raise ValueError("Either path or openmc.config[‘cross\_sections’] "  
147 “must be set”)  
 → 149 tree = ET.parse(path)  
150 root = tree.getroot()  
151 if root.find(‘directory’) is not None:

File /opt/anaconda3/3.10/anaconda3/envs/openmc-env/lib/python3.10/xml/etree/ElementTree.py:1222, in parse(source, parser)  
1213 “”“Parse XML document into element tree.  
1214  
1215 _source_ is a filename or file object containing XML data,  
(…)  
1219  
1220 “””  
1221 tree = ElementTree()  
 → 1222 tree.parse(source, parser)  
1223 return tree

File /opt/anaconda3/3.10/anaconda3/envs/openmc-env/lib/python3.10/xml/etree/ElementTree.py:569, in ElementTree.parse(self, source, parser)  
567 close\_source = False  
568 if not hasattr(source, “read”):  
 → 569 source = open(source, “rb”)  
570 close\_source = True  
571 try:

IsADirectoryError: [Errno 21] Is a directory: ‘/opt/endfb-vii.1-hdf5’

---

<div class="post-metadata">

**Author:** ![tjlaboss](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/tjlaboss/32/1390_2.png) [@tjlaboss](https://openmc.discourse.group/u/tjlaboss)\
**Post date:** [August 10, 2023, 5:11pm UTC](https://openmc.discourse.group/t/isadirectoryerror-errno-21-is-a-directory-opt-endfb-vii-1-hdf5/3259/2 "2023-08-10T17:11:49Z")

</div>

Try:

`export OPENMC_CROSS_SECTIONS=/opt/endfb-vii.1-hdf5/cross_sections.xml`

Explanation: The convention in OpenMC is a little difference than in MCNP. `$OPENMC_CROSS_SECTIONS` points to the equivalent of the `xsdir` file, instead of functioning like the `$DATAPATH` environment variable.

---

<div class="post-metadata">

**Author:** ![ron](https://avatars.discourse-cdn.com/v4/letter/r/ecae2f/32.png) [@ron](https://openmc.discourse.group/u/ron)\
**Post date:** [August 10, 2023, 8:10pm UTC](https://openmc.discourse.group/t/isadirectoryerror-errno-21-is-a-directory-opt-endfb-vii-1-hdf5/3259/3 "2023-08-10T20:10:55Z")

</div>

Thanks for the response and for the information.

I was trying to find out if OPENMC had any other path like statements.  
MCNP has several of them.  
’  
Can you help?

Thanks again.

Ron

---

<div class="post-metadata">

**Author:** ![tjlaboss](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/tjlaboss/32/1390_2.png) [@tjlaboss](https://openmc.discourse.group/u/tjlaboss)\
**Post date:** [August 10, 2023, 8:35pm UTC](https://openmc.discourse.group/t/isadirectoryerror-errno-21-is-a-directory-opt-endfb-vii-1-hdf5/3259/4 "2023-08-10T20:35:16Z")

</div>

[https://docs.openmc.org/en/stable/usersguide/data.html#runtime-configuration](https://docs.openmc.org/en/stable/usersguide/data.html#runtime-configuration)

`OPENMC_CROSS_SECTIONS`, `OPENMC_MG_CROSS_SECTIONS`, and `OPENMC_CHAIN_FILE`

---

<div class="post-metadata">

**Author:** ![ron](https://avatars.discourse-cdn.com/v4/letter/r/ecae2f/32.png) [@ron](https://openmc.discourse.group/u/ron)\
**Post date:** [August 10, 2023, 9:10pm UTC](https://openmc.discourse.group/t/isadirectoryerror-errno-21-is-a-directory-opt-endfb-vii-1-hdf5/3259/5 "2023-08-10T21:10:33Z")

</div>

Thank you for your response.  
I do have a follow up question.

The cross sections are in OPENMC\_CROSS\_SECTIONS=“/opt/endfb-vii.1-hdf5/cross\_sections.xml”  
What the names and locations for the default OPENMC\_CHAIN\_FILE and the OPENMC\_MG\_CROSS\_SECTIONS?  
Are there default files for these data, or did I miss the steps for downloading and installing them?

Thanks again.

Ron

---

<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:** [August 12, 2023, 11:24pm UTC](https://openmc.discourse.group/t/isadirectoryerror-errno-21-is-a-directory-opt-endfb-vii-1-hdf5/3259/6 "2023-08-12T23:24:21Z")

</div>

There is no default for any of the data sources. You can find several depletion chain files available at [https://openmc.org](https://openmc.org). We don’t have any preprepared multigroup cross section libraries so those you would have to generate yourself. Note however that if you’re using continuous energy cross sections there’s no need to set `OPENMC_MG_CROSS_SECTIONS`.

---

<div class="post-metadata">

**Author:** ![ron](https://avatars.discourse-cdn.com/v4/letter/r/ecae2f/32.png) [@ron](https://openmc.discourse.group/u/ron)\
**Post date:** [June 5, 2024, 1:50pm UTC](https://openmc.discourse.group/t/isadirectoryerror-errno-21-is-a-directory-opt-endfb-vii-1-hdf5/3259/7 "2024-06-05T13:50:50Z")

</div>

Got it.  
Thanks for the help.  
Ron
