jupyter notebook安装php kernel
前言
本人php开发,见同事在用jupyter notebook,就想着把php也能集中进去,研究了一下jupyter notebook是有kernel的概念,即kernel是作为解析界面输入的存在,接下来特出php kernel的安装
notebook php kernel 嵌入
标准编译流程
git clone git://github.com/mkoppanen/php-zmq.git
phpize && ./configure
make && make install
可以在make install之前尝试执行make test,如果以前你曾经编译过会遇到一下类似的问题:
PHP Warning: PHP Startup: zmq: Unable to initialize module
Module compiled with module API=20160303
PHP compiled with module API=20180731
因为你已经编译过,所以不会重新编译,即使你重新执行了上一步步骤,需要clean
make distclean
重新执行上面步骤即可。
接下来有个隐含的条件: 就是安装composer, 因为下一步会依赖composer下载依赖。
接下来下家jupyter-php-installer.phar,直接执行 php jupyter-php-installer.phar install即可
遇到的问题
ERROR: Error while trying to download Jupyter-PHP dependencies with Composer
弱智的bug,拼接命令的时候,直接把环境变量PATH拼接进去,所以如果你的PATH有空格,那么就会报这个错误
如果升级了php,而jupyter不起作用,那么除了重新安装上面的kernel外,/Library/Jupyter/kernels/jupyter-php/kernel.json,直接去kernel.json里面修改php对应版本的路径。
本作品采用 知识共享署名-相同方式共享 4.0 国际许可协议 进行许可。