WSL2中导入ssdeep提示找不到fuzzy_64.dll但文件存在的问题
问题分析:WSL2中import ssdeep报错但文件存在的原因
问题场景
在WSL2环境下执行import ssdeep时触发OSError,提示找不到fuzzy_64.dll,但通过ls命令确认该文件实际存在。
错误日志
Exception has occurred: OSError /usr/local/lib/python3.10/dist-packages/ssdeep_windows_32_64-0.0.1-py3.10.egg/ssdeep/bin\fuzzy_64.dll: cannot open shared object file: No such file or directory File "/home/WE1S/preprocessing/libs/fuzzyhasher/fuzzyhasher.py", line 19, in <module> import ssdeep File "/home/20230614_1549_test/modules/import/scripts/test.py", line 3, in <module> from libs.fuzzyhasher.fuzzyhasher import FuzzyHasher OSError: /usr/local/lib/python3.10/dist-packages/ssdeep_windows_32_64-0.0.1-py3.10.egg/ssdeep/bin\fuzzy_64.dll: cannot open shared object file: No such file or directory
文件验证输出
ls '/usr/local/lib/python3.10/dist-packages/ssdeep_windows_32_64-0.0.1-py3.10.egg/ssdeep/bin' fuzzy.dll fuzzy_64.dll
原因解析
- 路径分隔符不兼容:错误信息中的路径使用了Windows风格的反斜杠
\,而WSL2基于Linux系统,仅识别正斜杠/。该ssdeep库为Windows平台开发,硬编码了Windows路径格式,导致Linux环境下无法正确解析路径。 - 库文件格式不兼容:
fuzzy_64.dll是Windows专属的动态链接库,WSL2的Linux系统无法直接加载这类文件。Linux系统需要的是.so格式的共享库,而非Windows的.dll文件。
内容的提问来源于stack exchange,提问作者Ooker
相关产品推荐
相关产品推荐

