1

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
blackmamba
  • 1,952
  • 11
  • 34
  • 59
  • Possible duplicate of [ImportError: No module named model\_selection](http://stackoverflow.com/questions/40704484/importerror-no-module-named-model-selection) – DYZ Jan 28 '17 at 04:31
  • @DYZ: I am running this with py.test. Without it, it works fine. – blackmamba Jan 28 '17 at 04:37

0 Answers0