Q1:pefile is out of date 现象:ERROR: Your version of pefile is out of date. Please update to the latest version on https://github.com/erocarrera/pefile 解决方法:https://github.com/erocarrera/pefile下载,然后解压后执行python setup.py install |
Q2:安装weasyprint时报fatal error: ffi.h: No such file or directory错误 原因:主要是在 解决方法:apt-get install libffi-dev libxml2-dev libxslt1-dev 安装上述库后再执行命令pip install weasyprint |
Q3:使用weasyprint生成pdf出现中文乱码问题 原因:linux不存在对应的中文字体 解决方法:复制C:\Windows\Fonts下的宋体到/usr/share/fonts/chinese下,然后执行命令fc-cache -fv重新加载字体缓存 |
Q4:优化生成pdf生成时间 前提:apt-get install wkhtmltopdf xvfb python代码:from subprocess import callcall(["/usr/bin/xvfb-run", "--auto-servernum", "--server-num", "1", "/usr/bin/wkhtmltopdf", "-q", os.path.join(self.reports_path, "summary-report.html"), os.path.join(self.reports_path, "report.pdf")]) |
Q5:pip安装re2出现fatal error: re2/stringpiece.h: No such file or directory 原因:缺少re2框架 解决方法:https://github.com/google/re2下载zip包,解压完后执行make ,make install,然后再pip install re2 如果还报错的话需要把更新c++的库,strings /polyhawk/lib/libstdc++.so.6 | grep GLIBCXX, 更新到最新版 reference:http://*.com/questions/30956128/installation-of-re2-module-in-python-failed |
Q6:pip install m2crypto error error1:unable to execute 'swig': No such file or directory solution: sudo apt-get install swig error2:Unable to find 'openssl/opensslconf.h' solution: apt-get install libssl-dev ln -s /usr/include/x86_64-linux-gnu/openssl/opensslconf.h /usr/include/openssl/opensslconf.h
|
Q:python导入yara报import pe错误 github下载yara,重新编译生成so cd /tmp/ root@polyhawk-55:~# echo $PYTHONPATH 如此就可以在yara中使用python了 In [6]: import yara In [7]: yara.compile("/polydata/content/yara/rules/all.yar") |
ImportError: No module named past.builtins pip install future |