如何将模块与 Python 结合使用bsdiff
?虽然我可以使用 shell 脚本,但我更喜欢跨平台解决方案。
我已经下载了 bsdiff4-1.1.4 并尝试按如下方式运行 setup.py:
文件列表:
bsdiff4 build CHANGELOG.txt do.sh examples Makefile README.rst setup.py
我跑:
python3 setup.py build
我收到此错误:
/usr/lib/python3.4/distutils/dist.py:260: UserWarning: Unknown distribution option: 'entry_points'
warnings.warn(msg)
running build
running build_py
running build_ext
building 'bsdiff4.core' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.4m -c bsdiff4/core.c -o build/temp.linux-x86_64-3.4/bsdiff4/core.o
bsdiff4/core.c:8:20: fatal error: Python.h: No such file or directory
#include <Python.h>
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
答案1
需要安装 python3-dev
sudo apt-get install python3-dev