Skip to main content
 首页 » 编程设计

python之IPython 笔记本不再支持配置文件

2025年05月04日11over140

当前版本的 IPython-notebook 不支持配置文件。 IPython 工作得很好:ipython --profile test。但是 ipython notebook --profile test 失败,输出如下:

Examples 
-------- 
 
    ipython notebook                       # start the notebook 
    ipython notebook --profile=sympy       # use the sympy profile 
    ipython notebook --certfile=mycert.pem # use SSL/TLS certificate 
 
[C 14:04:28.232 NotebookApp] Bad config encountered during initialization: 
[C 14:04:28.232 NotebookApp] Unrecognized flag: '--profile' 

它仍然在示例中,但并没有真正起作用。有没有办法在 IPython-notebook 中使用配置文件?

下面是我的pip freeze:

appnope==0.1.0 
backports-abc==0.4 
backports.ssl-match-hostname==3.5.0.1 
certifi==2015.11.20.1 
decorator==4.0.6 
functools32==3.2.3.post2 
gnureadline==6.3.3 
ipykernel==4.2.1 
ipython==4.0.1 
ipython-genutils==0.1.0 
Jinja2==2.8 
jsonschema==2.5.1 
jupyter-client==4.1.1 
jupyter-core==4.0.6 
MarkupSafe==0.23 
mistune==0.7.1 
nbconvert==4.1.0 
nbformat==4.0.1 
notebook==4.0.6 
path.py==8.1.2 
pexpect==4.0.1 
pickleshare==0.5 
ptyprocess==0.5 
Pygments==2.0.2 
pyzmq==15.1.0 
simplegeneric==0.8.1 
singledispatch==3.4.0.3 
six==1.10.0 
terminado==0.5 
tornado==4.3 
traitlets==4.0.0 
wheel==0.24.0 

请您参考如下方法:

正如@birryree 在评论中提到的,IPython 4.0 现在是 Jupyter。 The docs with migration我不是很清楚。所以最简单的解决方案是安装 IPython 3,它仍然支持配置文件:

pip install ipython[notebook]==3.2.3