I am pretty new to Python and am trying to import train_test_split from sklearn.model_selection for a machine learning project, using the code:
26:reviews = [] 27:with open(file_name) as f: 28: for line in f: 29: review = json.loads(line) 30: reviews.append(Review(review['reviewText'], review['overall'])) 31:from sklearn.model_selection import train_test_split 32:training,test = train_test_split(reviews, test_size = 0.4, random_state=45) I am getting the error
"C:\Users\jacks\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\sklearn\__init__.py", line 79, in <module> from . import __check_build # noqa: F401 ImportError: cannot import name '__check_build' from partially initialized module 'sklearn' (most likely due to a circular import) I have tried googling around and have not found a reason for the error and I have downloaded the newest version of sklearn. I do not understand why the library is not importing correctly, nor why the error is for "__check_build" when I do not have anything in the code with that name. I am completely stuck. Does anyone know how to fix this problem?