From 60c451e3f938c8a21df984b5776ef149dce7bee5 Mon Sep 17 00:00:00 2001 From: NiklasV <139122850+NiklasVin@users.noreply.github.com> Date: Thu, 31 Oct 2024 08:33:32 +0100 Subject: [PATCH] Clarify installation procedure (#183) * Add note regarding the externally-managed-environment error * Provide commands that we use in tutorials. --------- Co-authored-by: Benjamin Rodenberg --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5f97135c..234b240a 100644 --- a/README.md +++ b/README.md @@ -27,9 +27,18 @@ preCICE-adapter for the open source computing platform FEniCS. It is recommended to install [fenicsprecice from PyPI](https://pypi.org/project/fenicsprecice/) via ```bash -pip3 install --user fenicsprecice +pip3 install fenicsprecice ``` +For more recent pip versions you may encounter the error `error: externally-managed-environment` during installation of the fenicsprecice. You can read why [here](https://packaging.python.org/en/latest/specifications/externally-managed-environments/). In this case, it is recommended to create a virtual environment and install the package in the virtual environment. The following commands will create the virtual environment `venv_name` at the location `path/of/your/venv/`: + +```bash +python3 -m venv --system-site-packages path/of/your/venv/venv_name +. path/of/your/venv/venv_name/bin/activate +``` + +You can replace `path/of/your/venv/venv_name` with the location and name you want to use for your virtual environment. The command `--system-size-packages` will allow the virtual environment to access the FEniCS installation on your system. Refer to the [Python documentation](https://docs.python.org/3/library/venv.html) for further details on virtual environments. + This should work out of the box, if all dependencies are installed correctly. If you face problems during installation or you want to run the tests, see below for a list of dependencies and alternative installation procedures ### Clone this repository and use pip3