I got this error when trying to run a python file with:
from sklearn.model_selection import train_test_split
The error is:
ImportError: cannot import name 'ThreadPool' from 'multiprocessing.pool' (/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/multiprocessing/pool.py)
However, when I execute the same line from the terminal as:
>>> from sklearn.model_selection import train_test_split
it works without any error.
Any idea what might cause this error? and how to fix it?
Mostly, these errors are caused by naming of other and current scripts with the names of library files. So renaming these helps you handle the error.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments