setup-pdm icon indicating copy to clipboard operation
setup-pdm copied to clipboard

github action cannot install pdm if python-venv is not installed

Open jiyoonlim123 opened this issue 1 year ago • 1 comments

I tried setup-python with python3.8 and server without python3.8-venv, It shows following errors.

Steps to reproduce

workflow.yml

- name: Setup PDM
  uses: pdm-project/setup-pdm@v4
  with:
       python-version: 3.8

Actual Behavior

Installing PDM (2.12.3): Creating virtual environment
The virtual environment was not created successfully because ensurepip is not
available.  On Debian/Ubuntu systems, you need to install the python3-venv
package using the following command.

    apt install python3.8-venv

You may need to use sudo with that command.  After installing the python3-venv
package, recreate your virtual environment.

Failing command: ['/github/home/.local/share/pdm/venv/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']

Error: The process '/usr/bin/python3' failed with exit code 1

Expected behavior

A successful PDM setup / installation step in the workflow.

Environment Information

  • Ubuntu 20.04
  • python3.8-venv is not installed

jiyoonlim123 avatar Feb 21 '24 23:02 jiyoonlim123

This can be work-arounded by setting up Python actions/setup-python@v5, then let pdm-project/setup-pdm@v4 re-use.

  steps:
    - name: Checkout
      uses: actions/checkout@v4

    - name: Setup python
      uses: actions/setup-python@v5
      with:
        python-version: '3.8'

    - name: Setup PDM
      uses: pdm-project/setup-pdm@v4

kien-truong avatar Aug 28 '24 09:08 kien-truong