# Python API not found using conda installation

**URL:** <https://openmc.discourse.group/t/python-api-not-found-using-conda-installation/6065>\
**Category:** User Support\
**Created:** [October 17, 2025, 10:03pm UTC](https://openmc.discourse.group/t/python-api-not-found-using-conda-installation/6065 "2025-10-17T22:03:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brian729](https://avatars.discourse-cdn.com/v4/letter/b/a8b319/32.png) [@Brian729](https://openmc.discourse.group/u/Brian729)\
**Post date:** [October 17, 2025, 10:03pm UTC](https://openmc.discourse.group/t/python-api-not-found-using-conda-installation/6065/1 "2025-10-17T22:03:52Z")

</div>

I’ve done an install using miniconda of the openmc environment using the exact commands in the installation guide and all worked with no errors. I activated the environment and did a pip list to verify openmc, and it is shown,  
(openmc-env) brian@1:~$ pip list  
Package Version

* * *

openmc 0.15.2  
\<Removed all the other packages - just showing that openmc is installed per the conda environment\>  
When I run python in this environment, it recognizes the import openmc command and I get functionality:  
(openmc-env) brian@1:~$ python  
Python 3.13.9 | packaged by conda-forge | (main, Oct 16 2025, 10:31:39) [GCC 14.3.0] on linux  
Type “help”, “copyright”, “credits” or “license” for more information.

> > > import openmc  
> > > t=openmc.Sphere  
> > > print(t)  
> > > \<class ‘openmc.surface.Sphere’\>

However, When running in IDLE in this same environment configuration, openmc module is not found:

Python 3.12.3 (main, Aug 14 2025, 17:47:21) [GCC 13.3.0] on linux  
Type “help”, “copyright”, “credits” or “license()” for more information.

================= RESTART: /home/brian/OpenMCPrograms/test2.py =================  
Traceback (most recent call last):  
File “/usr/lib/python3.12/idlelib/run.py”, line 580, in runcode  
exec(code, self.locals)  
File “/home/brian/OpenMCPrograms/test2.py”, line 1, in  
import openmc  
ModuleNotFoundError: No module named ‘openmc’

Same error occurs in Jupyter-notebook running in this conda environment.  
import openmc

* * *

ModuleNotFoundError Traceback (most recent call last)  
Cell In[1], line 1  
----\> 1 import openmc

ModuleNotFoundError: No module named ‘openmc’

Can someone point me where I’ve gone wrong?  
Thank you.  
Brian

---

<div class="post-metadata">

**Author:** ![jsy](https://avatars.discourse-cdn.com/v4/letter/j/f07891/32.png) [@jsy](https://openmc.discourse.group/u/jsy)\
**Post date:** [October 18, 2025, 2:09am UTC](https://openmc.discourse.group/t/python-api-not-found-using-conda-installation/6065/2 "2025-10-18T02:09:21Z")

</div>

> [@Brian729](#):
>
> File “/usr/lib/python3.12/idlelib/run.py”, line 580, in runcode

Did this mean that you use the system python? You should “conda activate openmc-env”first and use the conda environment python, then “python /path/to/your/test2.py”

---

<div class="post-metadata">

**Author:** ![Brian729](https://avatars.discourse-cdn.com/v4/letter/b/a8b319/32.png) [@Brian729](https://openmc.discourse.group/u/Brian729)\
**Post date:** [October 18, 2025, 5:03am UTC](https://openmc.discourse.group/t/python-api-not-found-using-conda-installation/6065/3 "2025-10-18T05:03:02Z")

</div>

I did conda activate openmc-env to start - you can see that in the prompts above with the (openmc-env) lead on the terminal prompt. But both IDLE and Jupyter-notebook don’t recognize the import openmc command.

All the best,

Brian

---

<div class="post-metadata">

**Author:** ![jsy](https://avatars.discourse-cdn.com/v4/letter/j/f07891/32.png) [@jsy](https://openmc.discourse.group/u/jsy)\
**Post date:** [October 18, 2025, 7:29am UTC](https://openmc.discourse.group/t/python-api-not-found-using-conda-installation/6065/4 "2025-10-18T07:29:04Z")

</div>

> [@Brian729](#):
>
> (openmc-env) brian@1:~$ python  
> Python 3.13.9 | packaged by conda-forge | (main, Oct 16 2025, 10:31:39) [GCC 14.3.0] on linux  
> Type “help”, “copyright”, “credits” or “license” for more information.

this shows that the python version in conda environment is 3.13.9, but here

> [@Brian729](#):
>
> Python 3.12.3 (main, Aug 14 2025, 17:47:21) [GCC 13.3.0] on linux  
> Type “help”, “copyright”, “credits” or “license()” for more information.
> 
> ================= RESTART: /home/brian/OpenMCPrograms/test2.py =================  
> Traceback (most recent call last):  
> File “/usr/lib/python3.12/idlelib/run.py”, line 580, in runcode

the python version is 3.12. So I think you didn’t activate the environment correctly. Maybe you can try to activate the openmc-env in a terminal and “python your\_file.py”

---

<div class="post-metadata">

**Author:** ![Brian729](https://avatars.discourse-cdn.com/v4/letter/b/a8b319/32.png) [@Brian729](https://openmc.discourse.group/u/Brian729)\
**Post date:** [October 18, 2025, 5:36pm UTC](https://openmc.discourse.group/t/python-api-not-found-using-conda-installation/6065/5 "2025-10-18T17:36:49Z")

</div>

You are correct about the version, though I activated it with conda activate openmc-env. I don’t know what else to do. And I’m trying to get Jupyter-notebook to recognize the import openmc command - python files run within python do work, but jupyter-notebook does not.
