Traceback (most recent call last): File "D:\software\Anaconda3\envs\NER\lib\site-packages\IPython\core\interactiveshell.py", line 3418, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "", line 1, in runfile('D:/Users/lee/Downloads/Compressed/ailearning-master/ailearning-master/ner/test.py', wdir='D:/Users/lee/Downloads/Compressed/ailearning-master/ailearning-master/ner') File "D:\software\PyCharm Community Edition 2019.1.1\helpers\pydev\_pydev_bundle\pydev_umd.py", line 197, in runfile pydev_imports.execfile(filename, global_vars, local_vars) # execute the script File "D:\software\PyCharm Community Edition 2019.1.1\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "D:/Users/lee/Downloads/Compressed/ailearning-master/ailearning-master/ner/test.py", line 342, in rs.fit(X_train, y_train) File "D:\software\Anaconda3\envs\NER\lib\site-packages\sklearn\utils\validation.py", line 63, in inner_f return f(*args, **kwargs) File "D:\software\Anaconda3\envs\NER\lib\site-packages\sklearn\model_selection\_search.py", line 765, in fit base_estimator = clone(self.estimator) File "D:\software\Anaconda3\envs\NER\lib\site-packages\sklearn\utils\validation.py", line 63, in inner_f return f(*args, **kwargs) File "D:\software\Anaconda3\envs\NER\lib\site-packages\sklearn\base.py", line 74, in clone new_object_params = estimator.get_params(deep=False) File "D:\software\Anaconda3\envs\NER\lib\site-packages\sklearn\base.py", line 195, in get_params value = getattr(self, key) AttributeError: 'CRF' object has no attribute 'keep_tempfiles'
好像是python 3.7不支持,尝试改成3.6.4
Please note and check the following: * The Python version is: Python3.6 from "D:\software\Anaconda3\envs\NER\python.exe" * The NumPy version is: "1.19.4" and make sure that they are the versions you expect. Please carefully study the documentation linked above for further help. Original error was: No module named 'numpy.core._multiarray_umath'
然后又要改numpy为 1.16.0
Traceback (most recent call last): File "D:\software\Anaconda3\envs\NER\lib\site-packages\IPython\core\interactiveshell.py", line 3418, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "", line 1, in runfile('D:/Users/lee/Downloads/Compressed/ailearning-master/ailearning-master/ner/test.py', wdir='D:/Users/lee/Downloads/Compressed/ailearning-master/ailearning-master/ner') File "D:\software\PyCharm Community Edition 2019.1.1\helpers\pydev\_pydev_bundle\pydev_umd.py", line 197, in runfile pydev_imports.execfile(filename, global_vars, local_vars) # execute the script File "D:\software\PyCharm Community Edition 2019.1.1\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "D:/Users/lee/Downloads/Compressed/ailearning-master/ailearning-master/ner/test.py", line 6, in import pandas as pd File "D:\software\PyCharm Community Edition 2019.1.1\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, **kwargs) File "D:\software\Anaconda3\envs\NER\lib\site-packages\pandas\__init__.py", line 38, in ) from e ImportError: C extension: No module named 'pandas._libs.interval' not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inp
然后又要重装pandas
File "C:\Users\lee\AppData\Roaming\Python\Python36\site-packages\sklearn\base.py", line 21, in from .utils import _IS_32BIT File "D:\software\PyCharm Community Edition 2019.1.1\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, **kwargs) File "C:\Users\lee\AppData\Roaming\Python\Python36\site-packages\sklearn\utils\__init__.py", line 20, in from scipy.sparse import issparse File "D:\software\PyCharm Community Edition 2019.1.1\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, **kwargs) File "D:\software\Anaconda3\envs\NER\lib\site-packages\scipy\__init__.py", line 151, in from scipy._lib._ccallback import LowLevelCallable File "D:\software\PyCharm Community Edition 2019.1.1\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, **kwargs) File "D:\software\Anaconda3\envs\NER\lib\site-packages\scipy\_lib\_ccallback.py", line 1, in from . import _ccallback_c ImportError: cannot import name '_ccallback_c'
然后又要重装scipy pip uninstall scipy pip install scipy
Traceback (most recent call last): File "D:\software\Anaconda3\envs\NER\lib\site-packages\IPython\core\interactiveshell.py", line 3418, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "", line 1, in runfile('D:/Users/lee/Downloads/Compressed/ailearning-master/ailearning-master/ner/test.py', wdir='D:/Users/lee/Downloads/Compressed/ailearning-master/ailearning-master/ner') File "D:\software\PyCharm Community Edition 2019.1.1\helpers\pydev\_pydev_bundle\pydev_umd.py", line 197, in runfile pydev_imports.execfile(filename, global_vars, local_vars) # execute the script File "D:\software\PyCharm Community Edition 2019.1.1\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "D:/Users/lee/Downloads/Compressed/ailearning-master/ailearning-master/ner/test.py", line 164, in import sklearn_crfsuite File "D:\software\PyCharm Community Edition 2019.1.1\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, **kwargs) File "D:\software\Anaconda3\envs\NER\lib\site-packages\sklearn_crfsuite\__init__.py", line 2, in from .estimator import CRF File "D:\software\PyCharm Community Edition 2019.1.1\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, **kwargs) File "D:\software\Anaconda3\envs\NER\lib\site-packages\sklearn_crfsuite\estimator.py", line 6, in import pycrfsuite File "D:\software\PyCharm Community Edition 2019.1.1\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, **kwargs) File "D:\software\Anaconda3\envs\NER\lib\site-packages\pycrfsuite\__init__.py", line 2, in from ._pycrfsuite import * File "D:\software\PyCharm Community Edition 2019.1.1\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, **kwargs) ModuleNotFoundError: No module named 'pycrfsuite._pycrfsuite'