PyV8 无法使用 pip 安装,无法在 Fedora 20 中编译

PyV8 无法使用 pip 安装,无法在 Fedora 20 中编译

我遇到了与这里完全相同的问题:https://code.google.com/p/pyv8/issues/detail?id=132,但答案也不起作用。

我正在尝试在 Fedora 20 中使用 pip 安装 PyV8。我得到了这个:

$ pip install pyv8

x86_64-pc-linux-gnu-g++ -pthread -fPIC -DBOOST_PYTHON_STATIC_LIB -Ilib/python/inc -Ilib/boost/inc -Ilib/v8/inc -I/usr/include/python2.7 -c src/Engine.cpp -o build/temp.linux-x86_64-2.7/src/Engine.o

In file included from src/Context.h:7:0,

             from src/Engine.h:7,

             from src/Engine.cpp:1:

src/Wrapper.h: In member function ‘const boost::python::api::object& CJavascriptArray::ArrayIterator::dereference() const’:

src/Wrapper.h:115:66: warning: returning reference to temporary [enabled by default]

x86_64-pc-linux-gnu-g++ -pthread -fPIC -DBOOST_PYTHON_STATIC_LIB -Ilib/python/inc -Ilib/boost/inc -Ilib/v8/inc -I/usr/include/python2.7 -c src/Wrapper.cpp -o build/temp.linux-x86_64-2.7/src/Wrapper.o

In file included from src/Wrapper.cpp:1:0:

src/Wrapper.h: In member function ‘const boost::python::api::object& CJavascriptArray::ArrayIterator::dereference() const’:

src/Wrapper.h:115:66: warning: returning reference to temporary [enabled by default]

src/Wrapper.cpp: In static member function ‘static void CPythonObject::SetupObjectTemplate(v8::Handle<v8::ObjectTemplate>)’:

src/Wrapper.cpp:311:84: error: invalid conversion from ‘v8::Handle<v8::Boolean> (*)(v8::Local<v8::String>, const v8::AccessorInfo&)’ to ‘v8::NamedPropertyQuery {aka v8::Handle<v8::Integer> (*)(v8::Local<v8::String>, const v8::AccessorInfo&)}’ [-fpermissive]

/usr/include/v8.h:2392:8: error:   initializing argument 3 of ‘void v8::ObjectTemplate::SetNamedPropertyHandler(v8::NamedPropertyGetter, v8::NamedPropertySetter, v8::NamedPropertyQuery, v8::NamedPropertyDeleter, v8::NamedPropertyEnumerator, v8::Handle<v8::Value>)’ [-fpermissive]

src/Wrapper.cpp:312:94: error: invalid conversion from ‘v8::Handle<v8::Boolean> (*)(uint32_t, const v8::AccessorInfo&) {aka v8::Handle<v8::Boolean> (*)(unsigned int, const v8::AccessorInfo&)}’ to ‘v8::IndexedPropertyQuery {aka v8::Handle<v8::Integer> (*)(unsigned int, const v8::AccessorInfo&)}’ [-fpermissive]

/usr/include/v8.h:2415:8: error:   initializing argument 3 of ‘void v8::ObjectTemplate::SetIndexedPropertyHandler(v8::IndexedPropertyGetter, v8::IndexedPropertySetter, v8::IndexedPropertyQuery, v8::IndexedPropertyDeleter, v8::IndexedPropertyEnumerator, v8::Handle<v8::Value>)’ [-fpermissive]

error: command 'x86_64-pc-linux-gnu-g++' failed with exit status 1

它说存在无效的转换错误。

我是否遗漏了什么?

答案1

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

相关内容