zhihao-chen / QASystemOnMedicalGraph

该项目是基于医疗领域知识图谱的问答系统。实现比较简单。
1.27k stars 333 forks source link

ModuleNotFoundError: No module named 'sklearn.externals.joblib' #12

Open yefeister opened 2 years ago

yefeister commented 2 years ago

运行kbqa_test.py,出现错误:ModuleNotFoundError: No module named 'sklearn.externals.joblib' in module pickle.py. 我的版本是python3.10. Traceback (most recent call last): File "C:\Users\Documents\QASystemOnMedicalGraph-master\kbqa_test.py", line 27, in handler = KBQA() File "C:\Users\Documents\QASystemOnMedicalGraph-master\kbqa_test.py", line 10, in init self.extractor = EntityExtractor() File "C:\Users\Documents\QASystemOnMedicalGraph-master\entity_extractor.py", line 23, in init self.tfidf_model = joblib.load(self.tfidf_path) File "C:\Users\Documents\QASystemOnMedicalGraph-master\venv\lib\site-packages\joblib\numpy_pickle.py", line 587, in load obj = _unpickle(fobj, filename, mmap_mode) File "C:\Users\Documents\QASystemOnMedicalGraph-master\venv\lib\site-packages\joblib\numpy_pickle.py", line 506, in _unpickle obj = unpickler.load() File "C:\Users\AppData\Local\Programs\Python\Python310\lib\pickle.py", line 1213, in load dispatchkey[0] File "C:\Users\AppData\Local\Programs\Python\Python310\lib\pickle.py", line 1529, in load_global klass = self.find_class(module, name) File "C:\Users\AppData\Local\Programs\Python\Python310\lib\pickle.py", line 1580, in find_class import(module, level=0) ModuleNotFoundError: No module named 'sklearn.externals.joblib'

123456jjaWHO commented 2 years ago

pip install Scikit-learn==0.20.4 -i https://pypi.tuna.tsinghua.edu.cn/simple

18118019819 commented 1 year ago

现在好像直接pip install joblib了,不包含在sklearn的包里了,然后直接import joblib

J-Jzf commented 7 months ago

请问解决了嘛,怎么解决的,我也是这个问题

kokyouu commented 2 weeks ago

现在好像直接pip install joblib了,不包含在sklearn的包里了,然后直接import joblib

直接import joblib好像也会报错ModuleNotFoundError: No module named 'sklearn'