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

No module named pip on self-hosted runner #2277

Open
michprev opened this issue Feb 13, 2025 · 4 comments
Open

No module named pip on self-hosted runner #2277

michprev opened this issue Feb 13, 2025 · 4 comments

Comments

@michprev
Copy link

Description

Hello,
I am observing the following error when using pypa/[email protected] in my action:

  /home/username/actions-runner/_work/_tool/Python/3.12.9/x64/bin/python: No module named pip
  Traceback (most recent call last):
    File "<stdin>", line 28, in <module>
    File "/home/username/actions-runner/_work/_tool/Python/3.12.9/x64/lib/python3.12/venv/__init__.py", line 80, in create
      self.post_setup(context)
    File "<stdin>", line 20, in post_setup
    File "/home/username/actions-runner/_work/_tool/Python/3.12.9/x64/lib/python3.12/subprocess.py", line 573, in run
      raise CalledProcessError(retcode, process.args,
  subprocess.CalledProcessError: Command '['/home/username/actions-runner/_work/_tool/Python/3.12.9/x64/bin/python', '-m', 'pip', '--python', '/home/username/actions-runner/_work/_temp/cibw/bin/python', 'install', '/home/username/actions-runner/_work/_actions/pypa/cibuildwheel/v2.22.0']' returned non-zero exit status 1.

The error happens at the Install cibuildwheel step (

# Install cibuildwheel
).

The machine is Ubuntu 23 with python3 and python3-pip installed through apt (externally managed environment).

Build log

No response

CI config

No response

@henryiii
Copy link
Contributor

You need to have setup-python to use our action. If you cannot use setup-python, you should not use our action either. Just use cibuildwheel directly with your externally managed pip.

@mayeut
Copy link
Member

mayeut commented Feb 25, 2025

There's probably something going wrong with setup-python indeed. Are there any logs for the setup-python sub-step of the action ?
The fact that update-environment: true seems to work suggests that it might be an LD_LIBRARY_PATH like issue. c.f. actions/setup-python#871 / actions/python-versions#275

@Czaki
Copy link
Contributor

Czaki commented Feb 25, 2025

May you try to create virtualenv and provide python by virtualenv to not have an externally managed environment?

@henryiii
Copy link
Contributor

Our action uses setup-python, which itself is not supposed to break like this - the links above might be the root bug.

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

No branches or pull requests

4 participants