Issue compiling Python on Mac

Hello devs and fellow users,

I’ve switched over from editing input xml files (provided by a professor) to attempting the python API, but am having an issue with compiling (that is probably an easy fix).

Now, I’ve downloaded an example python file from:

openmc/examples/python/basic/build-xml.py

On github to build the files myself and I cannot get the openmc module to work. As my terminal output is:

(base) bash-3.2$ python goodbyeNeutrons

Traceback (most recent call last):

File “goodbyeNeutrons”, line 1, in

import openmc

ModuleNotFoundError: No module named ‘openmc’

I’m not sure how to find/create the path as described in section 2.3.4 on readthedocs, and I know my python setup is working.

(base) bash-3.2$ python --version

Python 3.7.3

I am running the file out of my home directory and is also where my Anaconda3 directory is located.

Thank you for your time,

Paul

Hi Paul,

Sorry to hear you’re having trouble, but glad you’re looking to use the Python API for modeling!

Have you used the OpenMC’s Python API on this machine before?

If not, did you have any errors when running the ‘python setup.py install’ command? (or python setup.py install --user if you installed it only in your user space)

Cheers,

Patrick

Patrick,

Thanks for the quick response, and no I haven’t used the Python API on this before. Also I am pretty new to using the command line tool to get things done so havn’t used the ‘python setup.py install’ command previously within the conda env.

Do I use this command to install openmc? For Python I had used a pip command to install the current python version.

Best,

Paul

Hi Paul,

Let’s start a little more basic – how did you install OpenMC on your machine and what version did you install?

Best regards,
Paul R

Hi Paul,

I installed OpenMC on my mac by installing Anaconda3 and conda, with conda config --add channels conda-forge, then conda install openmc.

Also, I’m using version 10.

Thanks for your patience!

Paul J

hello Paul J

You can try anaconda3 --5.3.1version

(base) [root@centos-s-1vcpu-1gb-sfo2-01 tang]# conda list anaconda

packages in environment at /home/tang/anaconda3: