KVSlab / VaSP

A collection of tools for pre-processing, simulating, and post-processing vascular fluid-structure-interaction problems
https://kvslab.github.io/VaSP/
GNU General Public License v3.0
9 stars 4 forks source link

CI failing when updating `pip` and `setuptools` #159

Closed keiyamamo closed 6 months ago

keiyamamo commented 6 months ago

Hi @johannesring

I noticed that CI is failing due to https://github.com/KVSlab/VaSP/blob/5a13e677059a713374198d2942fe48a9d764f9a2/.github/workflows/check_and_test_package.yml#L35-L36

Run python3 -m pip install pip setuptools --upgrade
[11](https://github.com/KVSlab/VaSP/actions/runs/8794770856/job/24151981456#step:4:12)
error: externally-managed-environment

Do you have an idea how to fix this issue?

Best, Kei

johannesring commented 6 months ago

Here is the full error message:

Run python3 -m pip install pip setuptools --upgrade
11 error: externally-managed-environment
12 
13 × This environment is externally managed
14 ╰─> To install Python packages system-wide, try brew install
15     xyz, where xyz is the package you are trying to
16     install.
17     
18     If you wish to install a Python library that isn't in Homebrew,
19     use a virtual environment:
20     
21     python3 -m venv path/to/venv
22     source path/to/venv/bin/activate
23     python3 -m pip install xyz
24     
25     If you wish to install a Python application that isn't in Homebrew,
26     it may be easiest to use 'pipx install xyz', which will manage a
27     virtual environment for you. You can install pipx with
28     
29     brew install pipx
30     
31     You may restore the old behavior of pip by passing
32     the '--break-system-packages' flag to pip, or by adding
33     'break-system-packages = true' to your pip.conf file. The latter
34     will permanently disable this error.
35     
36     If you disable this error, we STRONGLY recommend that you additionally
37     pass the '--user' flag to pip, or set 'user = true' in your pip.conf
38     file. Failure to do this can result in a broken Homebrew installation.
39     
40     Read more about this behavior here: <https://peps.python.org/pep-0668/>
41 
42 note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at te risk of breaking your Python installation or OS, by passing --break-system-packages.
43 hint: See PEP 668 for the detailed specification.
44 Error: Process completed with exit code 1.

It looks like we can get around the problem by using --break-system-packages when upgrading pip.

keiyamamo commented 6 months ago

Thanks! I saw the message but wasn’t sure if --break-system-packages is a good option. But I guess it is OK in this case since we are just working on GitHub workflow and not on an actual machine.

johannesring commented 6 months ago

Yes, I agree.