Невозможно установить psycopg2 с помощью Github Actions из-за distutils

Я пытаюсь настроить CI/CD для своего проекта Django на Github. Я развертываю его на Heroku, для чего требуется пакет django-heroku, который в свою очередь зависит от пакета psycopg2. Когда я пытаюсь запустить этот рабочий процесс:

build-django:
runs-on: ubuntu-latest
steps:
  - uses: actions/checkout@v2
  - name: Set up Python
    uses: actions/setup-python@v2
    with:
      python-version: '3.10'
  - name: Install dependencies
    run: |
      python -m pip install --upgrade pip
      pip install -r requirements.txt
  - name: Run Django Tests
    run: |
      python manage.py test

Я получаю огромный журнал ошибок, который завершается следующим:

Copying psycopg2.egg-info to /opt/hostedtoolcache/Python/3.10.1/x64/lib/python3.10/site-packages/psycopg2-2.9.2-py3.10.egg-info
running install_scripts
Traceback (most recent call last):
<...>
ModuleNotFoundError: No module named 'distutils.command.bdist_wininst'

На моей машине все проверено. Почему я получил это сообщение?

Файл requirements.txt является

setuptools~=44.1.1
wheel~=0.37.1
django~=3.2.9
djangorestframework~=3.12.4
pip~=20.3.4
pytz~=2021.3
sqlparse~=0.4.2
asgiref~=3.4.1
h11~=0.12.0
attrs~=21.2.0
trio~=0.19.0
outcome~=1.1.0
sniffio~=1.2.0
sortedcontainers~=2.4.0
cffi~=1.15.0
idna~=3.3
six~=1.16.0
cryptography~=36.0.1
certifi~=2021.10.8
urllib3~=1.26.7
selenium~=4.1.0
pycparser~=2.21
wsproto~=1.0.0 
gunicorn~=20.1.0
django-heroku
Вернуться на верх