我有scikit版本0.18.1。没有py.test,如果我在我的终端上运行它,它工作正常。没有这样的错误。
我正在尝试导入model_selection,但py.test给出了以下错误:
==================================== ERRORS ====================================
_________________________ ERROR collecting test_knn.py _________________________
test_knn.py:14: in <module>
from knn import knn
knn.py:2: in <module>
from sklearn.model_selection import cross_val_score
E ImportError: No module named 'sklearn.model_selection'
=========================== 1 error in 1.63 seconds ============================
以下是我的.travis.yml
language: python
python:
- "2.7"
- "3.4"
- "3.5"
# command to install dependencies
install:
- pip install -r requirements.txt
# command to run tests
script: py.test