【发布时间】:2016-05-24 11:28:06
【问题描述】:
我有一个依赖 scipy 的包。我已经知道通过apt-get 安装 scipy 会给我们一个过时版本的软件包,并且通过pip 安装它会使 Travis VM 超时,所以我决定在我的测试期间下载并安装 Miniconda,就像许多其他的建议一样问题。
但是,每当我推送到 GitHub 并且 Travis 运行我的单元测试时,它都无法找到 scipy 包。错误信息只是ImportError: No module named 'scipy'。
这是我的.travis.yml 文件的内容。 python --version 正确指向“Python 3.4.4 :: Continuum Analytics, Inc.” conda list 显示已安装 scipy 0.17.0。如果有人有兴趣,这里是full log of my Travis build。
language: python
python:
# We don't actually use the Travis Python, but this keeps it organized.
- "3.4"
install:
- sudo apt-get update
# We do this conditionally because it saves us some downloading if the
# version is the same.
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh;
else
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
fi
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
# Useful for debugging any issues with conda
- conda info -a
- conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION numpy scipy scikit-learn matplotlib
- source activate test-environment
- conda list
- python --version
- whereis python
- python setup.py install
script: nosetests
【问题讨论】:
-
travis 默认使用 virtualenv for python,
which python的输出是什么? -
/home/travis/miniconda/envs/test-environment/bin/python在使用 conda 创建另一个 virtualenv 之后。 Here is the new build.
标签: python scipy travis-ci miniconda