I’m running Tuxedo OS on my system (a Ubuntu based distribution) and I’ve installed OpenMC from source. The last step is to follow section 2.5 and install the Python API. I’ve been able to add all of the prerequisites besides uncertainties using the UV Python package installer.
To install the Python API I begin by using sudo su to get into the root directory as instructed. I then cd into the OpenMC folder and run python -m pip install. This is where my problems begin.
I’ve tried:
python3 -m pip install
which returns the error:
error: externally-managed-environment
× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.
If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.
If you wish to install a non-Debian packaged Python application,
it may be easiest to use pipx install xyz, which will manage a
virtual environment for you. Make sure you have pipx installed.
See /usr/share/doc/python3.12/README.venv for more information
Reading online it sounds like I should be using pipx to create a separate virtual environment? I’m somewhat familiar with the venv. concept in Python, but either way repeating the steps with pipx didn’t work as far as I can remember.
At this point I’m just looking for the most straight forward way to run OpenMC using Python in VS Code.
Thank you.