我想安装PyV8。我通过以下方式安装:
sudo pip3 install pyv8
我收到错误消息:
Collecting pyv8
Downloading https://files.pythonhosted.org/packages/c6/fb/5c0512a373e3d0aad0b683f439e7bdd67f95a69e6473b76dc2cfdca2c43f/PyV8-0.5.zip
Installing collected packages: pyv8
Running setup.py install for pyv8 ... error
Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-0yqr1qf0/pyv8/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-u2aby1pu/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.5
copying PyV8.py -> build/lib.linux-x86_64-3.5
running build_ext
building '_PyV8' extension
creating build/temp.linux-x86_64-3.5
creating build/temp.linux-x86_64-3.5/src
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DBOOST_PYTHON_STATIC_LIB -Ilib/python/inc -Ilib/boost/inc -Ilib/v8/inc -I/usr/include/python3.5m -c src/Exception.cpp -o build/temp.linux-x86_64-3.5/src/Exception.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
In file included from src/Exception.cpp:1:0:
src/Exception.h:6:16: fatal error: v8.h: No such file or directory
#include <v8.h>
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-0yqr1qf0/pyv8/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-u2aby1pu/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-0yqr1qf0/pyv8/
我最近安装了python3-dev
。我该如何解决这个问题?看起来有些标头丢失了,但我怎么知道要安装什么?
答案 0 :(得分:0)
我通过应用以下命令解决了。我的Python是2.7.15。
sudo apt-get install libboost-all-dev
sudo apt-get install build-essential autoconf libtool pkg-config python-opengl python-imaging python-pyrex python-pyside.qtopengl idle-python2.7 qt4-dev-tools qt4-designer libqtgui4 libqtcore4 libqt4-xml libqt4-test libqt4-script libqt4-network libqt4-dbus python-qt4 python-qt4-gl libgle3 python-dev
sudo easy_install greenlet
sudo easy_install gevent
git clone https://github.com/buffer/pyv8.git
cd pyv8
sudo python setup.py build
sudo python setup.py install
可以在此处找到说明-https://github.com/buffer/thug/issues/170#issuecomment-225762492