为适应X64版Python,建议楼主修改以下代码
Opened this issue · 1 comments
**AnalysisCSN/CSN.py 中from core.chilkatCert.win32 import chilkat
改为import chilkat,要不然,x64位python报:**
Traceback (most recent call last):
File "C:\Users\admin\Desktop\ApkDetecter-master\ApkDetecter.py", line 17, in
from AnalysisCSN.CSN import CSN
File "C:\Users\admin\Desktop\ApkDetecter-master\AnalysisCSN\CSN.py", line 6, in
from core.chilkatCert.win32 import chilkat
File "C:\Users\admin\Desktop\ApkDetecter-master\core\chilkatCert\win32\chilkat.py", line 26, in
_chilkat = swig_import_helper()
File "C:\Users\admin\Desktop\ApkDetecter-master\core\chilkatCert\win32\chilkat.py", line 22, in swig_import_helper
_mod = imp.load_module('_chilkat', fp, pathname, description)
ImportError: DLL load failed: %1 不是有效的 Win32 应用程序。错误
为了增加容错性应该是修改为如下
from core.chilkatCert.win32 import chilkat
修改为
import platform
if platform.architecture()[0] == '64bit':
from core.chilkatCert.win64 import chilkat
else:
from core.chilkatCert.win32 import chilkat