【问题标题】:I can't install graphene-django in GitHub actions我无法在 GitHub 操作中安装 graphene-django
【发布时间】:2021-04-28 03:58:03
【问题描述】:

我正在构建一个 Django 项目,每当我推送时,我都会使用 GitHub 操作来运行 python manage.py test。问题是在项目中,我使用的是graphene-django 包,它可以通过pip install graphene-django 安装。问题是,由于某种原因,这似乎不起作用(它输出错误)。我已经尝试了一切:

  • pip install graphene-django
  • pip install "graphene-django>=2.0"
  • pip install --user graphene-django
  • pip install --user "graphene-django>=2.0"
  • pip3 install graphene-django
  • pip3 install "graphene-django>=2.0"
  • pip3 install --user graphene-django
  • pip3 install --user "graphene-django>=2.0"

其中一些命令显示不同的错误,但最常见的是:

Collecting promise>=2.1 (from graphene-django>=2.0)
  Downloading https://files.pythonhosted.org/packages/cf/9c/fb5d48abfe5d791cd496e4242ebcf87a4bb2e0c3dcd6e0ae68c11426a528/promise-2.3.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    ModuleNotFoundError: No module named 'setuptools'
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-5vr1pems/promise/

这是我的操作的 YAML 文件(最后一次 intslling 尝试):

name: Testing
on: push

jobs:
  test_vote:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Run Django unit tests
      run: |
        pip3 install --user django
        pip3 install --user "graphene-django>=2.0"
        python3 manage.py test
      env:
        # Random key
        SECRET_KEY: '!nj1v)#-y)e21t^u@-6tk+%+#vyzn30dp+)xof4q*y8y&%=h9l'

任何帮助都将不胜感激,因为我已经在这里待了大约一个小时,而在 course 中,老师花了大约 5 分钟。

谢谢!

【问题讨论】:

  • 我太笨了。对不起,我不知道模块意味着那个。你能把这个作为答案,所以我可以给你支票吗? @riQQ

标签: django github pip yaml github-actions


【解决方案1】:

在安装graphene-django之前安装模块setuptools

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-11-28
    • 2020-03-31
    • 2021-04-28
    • 2020-09-09
    • 2022-01-22
    • 2021-04-13
    • 2017-05-10
    • 1970-01-01
    相关资源
    最近更新 更多