我正在使用 python 3.6 开始新项目,我想将 circleci 附加到我的项目。
我的circle.yml是
machine:
timezone:
Asia/Seoul
python:
version: 3.6.0
dependencies:
pre:
- pip install -r requirements/ci.txt
test:
post:
- python manage.py test
和circleci错误
python-build: definition not found: 3.6.0
The following versions contain `3.6.0' in the name:
3.6.0b1
See all available versions with `pyenv install --list'.
If the version you need is missing, try upgrading pyenv:
cd /opt/circleci/.pyenv/plugins/python-build/../.. && git pull && cd -
((if (or (= "3.6.0" "system") (pyenv versions --bare | grep -x -q "'3.6.0'")) (pyenv global "3.6.0") (chain-and (pyenv install --skip-existing "" "3.6.0") (pyenv global "3.6.0") (pyenv rehash) (pip install virtualenv) (pip install nose) (pip install pep8) (pyenv rehash)))) returned exit code 2
Action failed: set python version to 3.6.0
似乎 circleci 不支持最新的 pyenv 版本。
我该如何解决?
最佳答案
您现在可以在 CircleCI(在默认的 Ubuntu 14.04 镜像中)中使用 Python 3.6.0,方法是在 circle.yml
中添加以下内容:
machine:
pre:
- cd /opt/circleci/.pyenv; git pull
python:
version: 3.6.0
不过,您在这里放弃的是大约 2 分钟的构建时间。这是一个解决方法,如果您需要 3.6.0,直到新的 CCI Ubuntu 14.04 镜像在接下来的 3 周左右出现。
关于python - 在 circleci 中使用 Python 3.6.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41381930/