问题描述:
初次运行时报以下错误:
...
File "D:\Workspace\Python\mcrm-Langchain\venv_38\lib\site-packages\pyhanlp\__init__.py", line 149, in <module>
_start_jvm_for_hanlp()
File "D:\Workspace\Python\mcrm-Langchain\venv_38\lib\site-packages\pyhanlp\__init__.py", line 41, in _start_jvm_for_hanlp
from pyhanlp.static import STATIC_ROOT, hanlp_installed_data_version, HANLP_DATA_PATH
File "D:\Workspace\Python\mcrm-Langchain\venv_38\lib\site-packages\pyhanlp\static\__init__.py", line 285, in <module>
install_hanlp_jar()
File "D:\Workspace\Python\mcrm-Langchain\venv_38\lib\site-packages\pyhanlp\static\__init__.py", line 160, in install_hanlp_jar
jar_version, jar_url, data_version, data_url = hanlp_latest_version()
...
ImportError: DLL load failed while importing _ssl: 找不到指定的模块
问题分析:
参考文档中内容:
自然语言处理学习笔记(三)————HanLP安装与使用_阿波拉的博客-CSDN博客
分析应该是下载jar时报错。
问题处理:
参考下面的内容,手动安装【OpenSSL on Windows】后解决问题:
None of the above worked for me, but instead it was a problem with OpenSSL on Windows 10 Enterprise. I fixed it by downloading and installing OpenSSL from here: Win32/Win64 OpenSSL Installer for Windows - Shining Light Productions
Python 3.7 anaconda environment - import _ssl DLL load fail error - Stack Overflow