I have scikit version 0.18.1. Without py.test, if I run this on my terminal it works fine. There is no such error.
I am trying to import model_selection but py.test gives me the following error:
==================================== 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 ============================
The following is my .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