Chinaunix首页 | 论坛 | 博客
  • 博客访问: 333263
  • 博文数量: 32
  • 博客积分: 822
  • 博客等级: 准尉
  • 技术积分: 388
  • 用 户 组: 普通用户
  • 注册时间: 2011-05-27 13:55
文章分类

全部博文(32)

文章存档

2019年(2)

2017年(4)

2016年(9)

2015年(1)

2014年(1)

2012年(2)

2011年(13)

我的朋友

分类: Python/Ruby

2016-10-20 15:42:18

Google V8/PyV8

Google V8 is Google’s open source JavaScript engine. V8 is written in C++ and is used in Google Chrome, the open source browser from Google. V8 implements ECMAScript as specified in ECMA-262, 3rd edition, and runs on Windows XP and Vista, Mac OS X 10.5 (Leopard), and Linux systems that use IA-32 or ARM processors. V8 can run standalone, or can be embedded into any C++ application.

PyV8 is a Python wrapper for the Google V8 engine. PyV8 acts as a bridge between the Python and JavaScript objects and supports the Google V8 engine in Python scripts.

In order to properly install Google V8 and PyV8 please follow the procedure described below.

  1. $ git clone https://github.com/buffer/pyv8.git
  2. $ cd pyv8
  3. ~/pyv8 $ python setup.py build
  4. ~/pyv8 $ sudo python setup.py install
如果遇到错误:
1:undefined symbol: PyUnicodeUCS4_FromEncodedObject
     需要重新编译Python,编译时加上参数:--enable-unicode=ucs4,Python2.7的编译安装:略过
2:需要安排boost库支持
    可以增加以下源到目录/etc/yum.repos.d下新建文件enetres.repo,详情可以参考:,此源提供PyV8 for CentOS的rpm包安装文件,不过是针对python2.6    
  1. 参考:yum update boost-devel-1.59.0-1.x86_64 --setopt=protected_multilib=false
源内容如下:    
  1. [enetres]
  2. name = ENETRES REPO for CentOS/RHEL $releasever
  3. baseurl = http://repo.enetres.net/
  4. enabled = 1
  5. protect = 0
  6. gpgcheck = 0
注:过程中可能会出现其它的依赖,请自行安装解决
安装完成后的测试情况:



阅读(3916) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~