Jupyter
跳到导航
跳到搜索
安装
- pip install --upgrade pip
- pip install jupyter
- 安装出错,需要
- /usr/lib/rpm/redhat/redhat-hardened-cc1 需要redhat-rpm-config
- Python.h:No such file or directory 需要python-devel
- pip install --upgrade jupyter
配置kernel
- python −m ipykernel install −−user −−name yourenv −−display−name yourenv_name
- 查看kernel是否背注册
jupyter kernelspec list
远程访问
- 生成配置文件
$jupyter notebook --generate-config
- 生成密码(后续写配置文件、登录Jupyter notebook需要)
- 打开python终端
In [1]: from IPython.lib import passwd In [2]: passwd() Enter password: Verify password: Out[2]: 'sha1:0e422dfccef2:84cfbcbb3ef95872fb8e23be3999c123f862d856'
- 修改默认配置文件
$vim ~/.jupyter/jupyter_notebook_config.py
进行如下修改(这里可以自行配置):
c.NotebookApp.ip='*' c.NotebookApp.password = u'sha:ce...刚才复制的那个密文' c.NotebookApp.open_browser = False c.NotebookApp.port =8888 #随便指定一个端口 c.IPKernelApp.pylab = 'inline'
- 启动Jupter notebook
$jupyter notebook &
- 远程访问
- 此时应该可以直接从本地浏览器直接访问http://address_of_remote:8888就可以看到jupyter的登陆界面。(特别注意:服务器上的Jupyter notebook不要关)
调用IDL
- 首先要安装anaconda环境,系统自带的环境找不到很多包
- sudo /usr/local/anaconda2/bin/conda install -c anaconda-nb-extensions nbbrowserpdf ;安装导出pdf的插件
- 设置环境变量PYTHONPATH包含IDL和PYTHON的可执行命令文件夹 (保证python中能调用IDL,python bridge)
- 具体是包含/usr/local/exelis/idl85/bin/bin.linux.x86_64, /usr/local/exelis/idl85/lib/bridges
- 设置IDL的库文件在动态链接库文件的目录中
- 将<IDL_DIR>/lib/bridges/kernels/IDL/kernel.json 复制到 /usr/share/jupyter/kernels/IDL目录下
- 设置PATH包含IDL的可执行命令文件夹 (不确定是否一定需要)