jurplel / install-qt-action

Install Qt on your Github Actions workflows with just one simple action
MIT License
446 stars 78 forks source link

Fails to install Qt on macos #230

Closed MehdiChinoune closed 2 months ago

MehdiChinoune commented 3 months ago
Automatic cache miss, will cache this run
/usr/local/bin/brew install p7zip
Warning: p7zip 17.05 is already installed and up-to-date.
To reinstall 17.05, run:
  brew reinstall p7zip
/usr/local/bin/python3 -m pip install setuptools wheel py7zr==0.20.*
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try brew install
    xyz, where xyz is the package you are trying to
    install.

    If you wish to install a non-brew-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip.

    If you wish to install a non-brew packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
Error: Error: The process '/usr/local/bin/python3' failed with exit code 1

This started happening just recently

Runner Image
  Image: macos-13
  Version: 20240327.2
  Included Software: https://github.com/actions/runner-images/blob/macos-13/20240327.2/images/macos/macos-13-Readme.md
  Image Release: https://github.com/actions/runner-images/releases/tag/macos-13%2F20240327.2

It looks like Homebrew has implemented PEP-0668 https://peps.python.org/pep-0668/

pzhlkj6612 commented 3 months ago

Hi! Could you please provide your workflow YAML file? A snippet about this action would be enough.

MehdiChinoune commented 3 months ago
  macos:
    runs-on: macos-${{ matrix.macos_ver }}
    name: macos
    strategy:
      fail-fast: false
      matrix:
        QT_VER: [5.15, 6.6.3]
        macos_ver: [13, 14]
    env:
      HOMEBREW_NO_AUTO_UPDATE: 1
      HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1

    steps:
      - name: Install prerequisties
        run: |
          brew list -1 | grep python | while read formula; do brew unlink $formula; brew link --overwrite $formula; done
          brew update
      - name: Install Qt
        uses: jurplel/install-qt-action@v3
        with:
          setup-python: false
          version: ${{ matrix.QT_VER }}
          dir: ${{ github.workspace }}/Qt
          archives: qtbase

brew link/unlink is a workaround a known issue https://github.com/actions/setup-python/issues/577. Withou it only macos-14 fails

MehdiChinoune commented 2 months ago

For anyone who hit the same issue. the only woraround I found is to install Qt from Homebrew.

I am closing the issue, Please don't reopen.

pzhlkj6612 commented 2 months ago

Hi, @MehdiChinoune . Would you mind if others discuss the same problem here without re-opening this issue?

MehdiChinoune commented 2 months ago

Please open a new issue. I don't want to get any notification about it.