简体   繁体   中英

PyV8 - error during installation

I would like to install PyV8. I install it via:

sudo pip3 install pyv8

I receive error message:

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/

I have installed python3-dev latest. How should I solved this issue? It looks like some header missing, but how should I know what to install?

I solved by applying the following sets of commands. My Python is 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

The instruction was found here - https://github.com/buffer/thug/issues/170#issuecomment-225762492

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM