Travis CI突然失败:找不到conda命令

时间:2015-12-09 18:54:21

标签: travis-ci anaconda conda miniconda

我的travis-ci构建中我的conda环境从未出现过问题,但它突然失败了。这是我的剧本

language: python - "2.7"

before_install:
    - wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh
    - chmod +x miniconda.sh
    - "./miniconda.sh -b"
    - export PATH=/home/travis/miniconda/bin:$PATH
    - conda update --yes conda
    - sudo rm -rf /dev/shm
    - sudo ln -s /run/shm /dev/shm
install:
    - conda install --yes python="2.7" psutil sphinx numpy scipy gdal cython h5py pycurl shapely mock matplotlib
    - pip install --user travis-sphinx

script:
    travis-sphinx build

after_success:
    travis-sphinx deploy

现在,当我的脚本尝试运行时,我在miniconda安装部分中出现此错误

0K$ wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh
--2015-12-08 23:13:29--  http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh
Resolving repo.continuum.io (repo.continuum.io)... 75.101.148.13, 23.21.145.66, 23.21.82.148, ...
Connecting to repo.continuum.io (repo.continuum.io)|75.101.148.13|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 23460669 (22M) [application/octet-stream]
Saving to: `miniconda.sh'


 0% [                                       ] 0           --.-K/s              
32% [===========>                           ] 7,649,288   23.2M/s              
100%[======================================>] 23,460,669  47.1M/s   in 0.5s    

2015-12-08 23:13:29 (47.1 MB/s) - `miniconda.sh' saved [23460669/23460669]

travis_time:end:075d0cf3:start=1449616409171750964,finish=1449616409704281401,duration=532530437
[0Ktravis_fold:end:before_install.1
[0Ktravis_fold:start:before_install.2
[0Ktravis_time:start:00b7d89f
[0K$ chmod +x miniconda.sh
travis_time:end:00b7d89f:start=1449616409714027799,finish=1449616409723035702,duration=9007903
[0Ktravis_fold:end:before_install.2
[0Ktravis_fold:start:before_install.3
[0Ktravis_time:start:2ab0861c
[0K$ ./miniconda.sh -b
PREFIX=/home/travis/miniconda2
installing: python-2.7.10-2 ...
installing: conda-env-2.4.4-py27_0 ...
installing: openssl-1.0.2d-0 ...
installing: pycosat-0.6.1-py27_0 ...
installing: pyyaml-3.11-py27_1 ...
installing: readline-6.2-2 ...
installing: requests-2.8.1-py27_0 ...
installing: sqlite-3.8.4.1-1 ...
installing: tk-8.5.18-0 ...
installing: yaml-0.1.6-0 ...
installing: zlib-1.2.8-0 ...
installing: conda-3.18.3-py27_0 ...
installing: pycrypto-2.6.1-py27_0 ...
installing: _cache-0.0-py27_x0 ...
Python 2.7.10 :: Continuum Analytics, Inc.
creating default environment...
installation finished.
travis_time:end:2ab0861c:start=1449616409732223830,finish=1449616414909394424,duration=5177170594
[0Ktravis_fold:end:before_install.3
[0Ktravis_fold:start:before_install.4
[0Ktravis_time:start:15b176f5
[0K$ export PATH=/home/travis/miniconda/bin:$PATH
travis_time:end:15b176f5:start=1449616414917629217,finish=1449616414924347844,duration=6718627
[0Ktravis_fold:end:before_install.4
[0Ktravis_fold:start:before_install.5
[0Ktravis_time:start:0ece3359
[0K$ conda update --yes conda
/home/travis/build.sh: line 45: conda: command not found    <------- ERROR HERE
travis_time:end:0ece3359:start=1449616414932354520,finish=1449616414940585261,duration=8230741
[0K
[31;1mThe command "conda update --yes conda" failed and exited with 127 during .[0m

我不确定为什么构建突然无法更新conda,有关为什么会发生这种情况的任何线索?

1 个答案:

答案 0 :(得分:4)

问题是由于对miniconda的改变造成的。它现在安装在~/miniconda2而不是~/miniconda下。您只需将travis.yml文件的相应行更改为:

    - export PATH=/home/travis/miniconda2/bin:$PATH