Gitlab-runner 运行 python2 而不是 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

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

在线运行作业测试,我收到此错误:它没有任何意义!

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

在此处输入图片说明

在此处输入图片说明

雷科夫尼

您显示的屏幕截图,作业是使用 运行的shell-executor,因此在您安装了 的任何机器上使用 Python 版本gitlab-runner

看起来您想使用docker-executorfor using image: python:3.6,因此我将重新安装 runner 以使用docker executor

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

另一个问题可能是您没有标记跑步者,并且使用了错误的gitlab-runner. 确保您已标记您的 shell / docker runners,即使用shell-runnerdocker-runner,然后在test作业中添加:

tags:
  - docker-runner

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

使用新的python插件时,如何告诉snapcraft将我的代码运行为python2而不是python3?

gitlab-runner随机以root身份运行,而不是用户gitlab-runner

VSCode运行Python 2而不是3

代码在Python 3中运行,而不是在Python 2中运行

iPython在Python 3而不是Python 2上运行

GCP Composer-如何运行Python 3而不是Python 2

让IPython使用Python 3而不是Python 2运行

如何设置“ python”命令指向python2而不是python3?

是否有适当的方法使web2py使用Python3而不是Python2?

如何将Syntastic设置为python3检查器而不是python2

FreeBSD:在uwsgi中使用python3而不是python2

如何指示 jupyter 使用 python2 而不是 python3

如何使python3命令运行Python 3.6而不是3.5?

使用python3而不是python运行Flask

如何使virtualenv运行Python 3而不是Python 2.7?

在 Ubuntu 中使用 python 而不是 python3 运行

如何捕获在python2中在python3中运行的命令的输出?

指示debhelper使用python3,但使用python2运行setup.py

为什么要通过python2运行guake,但错误中存在“ python3”?

gitlab-runner运行os依赖脚本

GitLab Runner应该实际在哪里运行?

使用gitlab Runner时Python无法识别为命令

Gitlab CI Runner无法以Python导入Google.Cloud

Gitlab CI-gitlab-runner以root身份运行

Python2 到 Python3 的转换?类型错误:内存视图:需要类似字节的对象,而不是“str”

使用#!python2无法在Python 2下运行

python2 / 3中input()的区别

终端上的 python3 命令运行 python 3.8 而不是 python 3.9

在使用Python2的共享PC上运行Python3吗?安装和运行冲突,还原到Py2库