# Ronlinmd@gmail.com

**URL:** <https://openmc.discourse.group/t/ronlinmd-gmail-com/4275>\
**Category:** User Support\
**Created:** [May 15, 2024, 6:47pm UTC](https://openmc.discourse.group/t/ronlinmd-gmail-com/4275 "2024-05-15T18:47:19Z")\
**Posts on this page:** 1\
**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:** [May 15, 2024, 6:47pm UTC](https://openmc.discourse.group/t/ronlinmd-gmail-com/4275/1 "2024-05-15T18:47:19Z")

</div>

To all

Please accept my apologies if this topic isn’t within the guidelines of OPENMC.  
I haven’t been able to find a forum for the MCNPy application.

I was trying to use the MCNPy tools to convert an MCNP6 input file into OPENMC.  
The function that I was trying to use is:  
mcnpy.translate\_mcnp\_openmc.mcnp\_to\_openmc

I am using MCNP 6.3 on a Windows platform.  
I am running the latest version of Ubuntu on a WSL2 environment.  
I have OPENMC and MCNPY installed into the same Conda environment.  
I just installed OPENMC, so I should have the latest version.  
I am loosely using an example from the MCNPy site to try to convert an existing MCNP6 input file named room.mcnp.  
I am using ANACONDA-NAVIGATOR to enter and test the input.

Below is the input and response of A-N.

Thank you for your time and consideration.

Ron LaVera

import mcnpy  
Metamodel Gateway Server Already Running  
I slept for: 0.0 seconds!  
mcnp\_file\_paty = “ipynb/mcnpy-examples/room.mcnp”

# Translate to OpenMC.

openmc\_model = mcnpy.translate\_mcnp\_openmc.mcnp\_to\_openmc(“room.OMC”)

# OpenMC XML files are automatically serialized.

AttributeError Traceback (most recent call last)  
Cell In[3], line 2  
1 # Translate to OpenMC.  
----\> 2 openmc\_model = mcnpy.translate\_mcnp\_openmc.mcnp\_to\_openmc(“room.OMC”)  
3 # OpenMC XML files are automatically serialized.

File ~/anaconda3/envs/openmc-env/lib/python3.12/site-packages/mcnpy/translate\_mcnp\_openmc.py:336, in mcnp\_to\_openmc(mcnp\_deck)  
320 “”“Translate MCNP Deck to OpenMC Model.  
321  
322 Parameters  
(…)  
332 OpenMC model materials.  
333 “””  
335 # MCNP deck decomposition and processing.  
 → 336 mcnp\_deck = mp.Deck.read(mcnp\_deck.\_deck, renumber=True)  
337 print(‘Decomposing Geometry…’)  
338 decompose\_mcnp(mcnp\_deck)

AttributeError: ‘str’ object has no attribute ‘\_deck’
