Python API not found using conda installation

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

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”

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

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

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”

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.