2016-12-29 63 views
4

我开始使用python 3.6创建新项目,我想将circleci附加到我的项目中。在circleci中使用Python 3.6.0

我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版本。

我该如何解决?

+1

我想你必须使用测试版,直到CircleCI支持最终版本。 – jonrsharpe

+0

我可以在circleci上安装最新版本的pyenv吗? – Curzy

回答

5

您可以通过在circle.yml以下的CircleCI使用Python 3.6.0(在Ubuntu默认14.04图片)现在:

machine:                                         
    pre:                                         
    - cd /opt/circleci/.pyenv; git pull                                 
    python:                                         
    version: 3.6.0 

什么你在这里放弃是约2分钟的编译时间虽然。如果你需要3.6.0,这是一个解决方法,直到在未来3周左右新的CCI Ubuntu 14.04映像发布。

+0

这看起来很奇怪,我得到:cd /opt/circleci/.pyenv; git pull /home/ubuntu/.rvm/scripts/extras/bash_zsh_support/chpwd/function.sh:line 5:cd:/opt/circleci/.pyenv:没有这样的文件或目录 fatal:不是git存储库(或任何父目录):.git cd /opt/circleci/.pyenv; git pull返回退出码128 操作失败:cd /opt/circleci/.pyenv; git pull – Rambatino

1

对于那些今天发现这个问题的人,CircleCI已经修正了这个问题,所以现在标准配置通过Python 3.6.1工作。例如,我的circle.yml使用3.6.1:

machine: 
    python: 
    version: 3.6.1 

... 
+1

仍然不适用于我:( – Inti

+0

@Inti你可以分享你使用这种语法看到什么错误吗? –

+1

'''python-build:定义未找到:3.6.1 查看所有可用的版本'pyenv install --list' 如果您需要的版本缺失,请尝试升级pyenv: cd /home/ubuntu/.pyenv/plugins/python-build/../ .. && git pull && cd (pyenv global“3.6.1”)(((if(或(=“3.6.1”“system”)(pyenv versions --bare | grep -x -q''3.6.1'“)) (pyenv rehash)(pip install virtualenv)(pip install nose)(pip install pep8)(pyenv rehash) ))))返回退出代码2 Action failed:set python version to 3.6.1''' – Inti