Gitlab-运行ner 运行 python2 代替 python 3

Gitlab-runner run python2 instead of python 3

这是我的 gitlab-ci.yml 文件:

image: python:3.6

before_script:
  - python --version
  - pip install -r requirements.txt

stages:
  - test

test:
  stage: test
  script:
    - chmod +x ./scripts/lint.sh
    - ./scripts/lint.sh
    - chmod +x ./scripts/tests.sh
    - ./scripts/tests.sh

请注意,在我的本地机器上,作业是 运行ning 没有任何问题,它正在使用 python 3.6.13

运行在线测试工作,我得到这个错误:没有任何意义!

下面是 运行ner 的配置,可以 运行 未标记的作业和错误消息。

您显示的屏幕截图,工作是 运行 使用 shell-executor,因此在您安装了 [=12= 的任何机器上使用 Python 版本]上。

看起来您想使用 docker-executor 来使用 image: python:3.6,所以我会重新安装 运行ner 以使用 docker executor

或者,您可以更新使用 shell 执行器的机器,改为使用 Python 3。

另一个问题可能是您没有标记您的 运行 用户,并且使用了错误的 gitlab-runner。确保你已经标记了你的 shell / docker 运行 人,即用 shell-runnerdocker-runner,然后在 test 工作中,添加:

tags:
  - docker-runner