I’m trying to get openMC running to easily deal with cross section data in a Jupyter notebook. I’d like to build from source rather than get code from the PPA. Hopefully everything will be using python3 on my Ubuntu 16.10 computer, but it appears something tries to use python 2.7:
IPython 6.0+ does not support Python 2.6, 2.7, 3.0, 3.1, or 3.2.
When using Python 2.7, please install IPython 5.x LTS Long Term Support version.
Beginning with IPython 6.0, Python 3.3 and above is required.
Thanks, this seems to have immediately done the trick in terms of no error messages arriving. Unfortunately, after running with “cmake …/openmc -DPYTHON_EXECUTABLE=python3”, I receive the error message:
`
[gavin][~/code/openmc-build]> make test
Running tests…
Test project /home/gavin/code/openmc-build
Start 1: test_asymmetric_lattice.py
Could not find executable /home/gavin/code/openmc-build/python3
`
Moreover, attempting to use openmc after “sudo make install” gives
`
[gavin][~/code/openmc]> which openmc
/usr/local/bin/openmc
[gavin][~/code/openmc]> openmc
openmc: error while loading shared libraries: libopenmc.so: cannot open shared object file: No such file or directory
For the first issue, perhaps try using an absolute path, i.e., -DPYTHON_EXECUTABLE=/usr/bin/python3 and see if that helps. For the second issue, try adding the directory containing libopenmc.so (in your case, most likely /usr/local/lib/) to your LD_LIBRARY_PATH environment variable.
Another thing you may want to consider, and that I would generally recommend, is to use a virtual environment, either through Python itself (the venv module) or using a distribution like Anaconda. Anaconda has its own version of virtual environments (conda environments). When you use a virtual environment, ‘which python’ will show the Python interpreter that is installed as part of that environment, so when cmake is run there will be no confusion. The problem in your case is that in Ubuntu, /usr/bin/python is actually Python 2, not Python 3.