iPython (python 2) - ImportError: No module named model_selection
问题 iPython Notebook Python 2 Complaining about this line: from sklearn.model_selection import train_test_split Why isn't model selection working? 回答1: In order to remedy this issue, you need to first find out if you are importing the actual sklearn package, and not just some script with the name sklearn.py saved somewhere in your working directory. The way Python imports modules is somewhat similar to the way it finds variables in its namespace ( Local , Enclosed , Global , Built-in ). In this