1 、安装boost : PyV8 依赖于Boost
yum install boost
yum install boost-devel
yum install boost-doc
2 、下载pyv8文件
github 地址: https://github.com/emmetio/pyv8-binaries
将PyV8.py以及_PyV8.so上传到 python 的 site-packages目录下 即可
注意: 你下载的包里 。文件是这样的:
需要把 _PyV8.cpython-33m.so 重命名为 : _PyV8.so
(py3) [root@localhost site-packages]# unzip pyv8-linux64-p3.zip
Archive: pyv8-linux64-p3.zip
inflating: _PyV8.cpython-33m.so
inflating: PyV8.py
(py3) [root@localhost site-packages]# rm -rf pyv8-linux64-p3.zip
(py3) [root@localhost site-packages]# mv _PyV8.cpython-33m.so _PyV8.so
(py3) [root@localhost site-packages]# ls
3 测试 :
(py3) [root@localhost site-packages]# python
Python 3.6.3 (default, Oct 8 2018, 10:37:35)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import PyV8
>>>
不报错。即成功
评论前必须登录!
立即登录 注册