python - 在 circleci 中使用 Python 3.6.0

标签 python integration circleci pyenv python-3.6

我正在使用 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/

相关文章:

python - BeautifulSoup 获得标签.id

java - 在Hbase中存储列表数据?

Android:在surfaceview上实现admob

java - 如何将Scala语言与Spring Security集成

environment-variables - CircleCI 插入环境变量

python - Canvas 对象标签 : not the type I originally gave it

python - 如何以编程方式在 django 1.7.6 中触发密码重置电子邮件?

maven - 如何衡量 RestFul API 的代码覆盖率

android - React Native 迁移 - FaSTLane 构建仅在 CircleCI 上针对 iOS "Archive failed"失败

android - CircleCI麻烦与gradlew在另一个文件夹