Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Travis CI suddenly fails: conda command not found

I've never had a problem with my conda environment in my travis-ci build, but it's suddenly started failing. Here's my script

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

Now when my script attempts to run I get this error in the miniconda install section

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

I'm not sure why the build suddenly fails updating conda, any clues as to why this would happen?

like image 342
Syntactic Fructose Avatar asked Dec 09 '15 18:12

Syntactic Fructose


People also ask

Why is conda not found?

If you face the 'conda command not found' error, the first and most common solution is to ensure you have conda installed. You can install conda using either the anaconda or miniconda packages. In this tutorial, we will use the anaconda installer.

Why is conda command not found Mac?

Trying to use conda when conda is not in your PATH causes errors such as “command not found.” NOTE: Replace $HOME/miniconda/bin/activate with the path to the activate script in your conda installation. To set the PATH permanently, you can add a line to your . bashrc file.

How do you initialize conda?

In order to initialize after the installation process is done, first run source <path to conda>/bin/activate and then run conda init .


1 Answers

The problem is caused by a change to miniconda. It now installs under ~/miniconda2 instead of ~/miniconda. You just need to change the corresponding line of your travis.yml file to:

    - export PATH=/home/travis/miniconda2/bin:$PATH
like image 75
jcrudy Avatar answered Sep 20 '22 22:09

jcrudy