Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI failing when updating pip and setuptools #159

Closed
keiyamamo opened this issue Apr 23, 2024 · 3 comments · Fixed by #161
Closed

CI failing when updating pip and setuptools #159

keiyamamo opened this issue Apr 23, 2024 · 3 comments · Fixed by #161

Comments

@keiyamamo
Copy link
Collaborator

Hi @johannesring

I noticed that CI is failing due to

- name: Upgrade pip and setuptools
run: python3 -m pip install pip setuptools --upgrade

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
Copy link
Collaborator

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
Copy link
Collaborator Author

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
Copy link
Collaborator

Yes, I agree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants