jupyter-notebook - 干净地卸载损坏的 jupyter nbextension
问题描述
前段时间我安装beakerx
了一个更新,安装失败了。每次我启动 IPython 时,都会显示一个警告。我怎样才能干净地摆脱扩展和这个输出?
[IPKernelApp] WARNING | Error in loading extension: beakerx.autotranslation
Check your config files in /Users/cls/.ipython/profile_default
Traceback (most recent call last):
File "/Users/cls/anaconda3/lib/python3.6/site-packages/IPython/core/shellapp.py", line 261, in init_extensions
self.shell.extension_manager.load_extension(ext)
File "/Users/cls/anaconda3/lib/python3.6/site-packages/IPython/core/extensions.py", line 80, in load_extension
mod = import_module(module_str)
File "/Users/cls/anaconda3/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 941, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'beakerx'
[IPKernelApp] WARNING | Error in loading extension: beakerx_magics.kernel_magic
Check your config files in /Users/cls/.ipython/profile_default
Traceback (most recent call last):
File "/Users/cls/anaconda3/lib/python3.6/site-packages/IPython/core/shellapp.py", line 261, in init_extensions
self.shell.extension_manager.load_extension(ext)
File "/Users/cls/anaconda3/lib/python3.6/site-packages/IPython/core/extensions.py", line 80, in load_extension
mod = import_module(module_str)
File "/Users/cls/anaconda3/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 941, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'beakerx_magics'
解决方案
遵循卸载说明后,我grep -r beakerx *
在 virtualenv 的根目录中运行并发现了以下碎片:
etc/jupyter/jupyter_notebook_config.json: "beakerx": false
etc/ipython/ipython_config.py:c.InteractiveShellApp.extensions = ['beakerx.autotranslation',
etc/ipython/ipython_config.py:'beakerx_magics.kernel_magic',
etc/ipython/ipython_config.py:'beakerx_magics.groovy_magic',
etc/ipython/ipython_config.py:'beakerx_magics.clojure_magic',
etc/ipython/ipython_config.py:'beakerx_magics.kotlin_magic',
etc/ipython/ipython_config.py:'beakerx_magics.scala_magic',
etc/ipython/ipython_config.py:'beakerx_magics.sql_magic',
etc/ipython/ipython_config.py:'beakerx_magics.java_magic'
我从上述文件中删除了违规行,错误消息消失了。
为了ipython_config.py
c = get_config()
c.InteractiveShellApp.extensions = [
]
为了jupyter_notebook_config.json
{
"NotebookApp": {
"nbserver_extensions": {
}
},
"KernelSpecManager": {}
}
推荐阅读
- ubuntu - 尝试将端口 53 从一个虚拟机 ping 到同一网络上的另一个虚拟机时,端口 53 显然被阻止
- rsyslog - rsyslog 并非所有日志都存在于中央日志服务器上
- ruby-on-rails - Ruby on Rails - 与 to_f 求和返回错误值
- sql - SQL CASE 语句需要处理Text
- google-apps-script - FormResponse.getRespondentEmail() 不适用于已重命名的 G Suite 用户
- spring-boot - Spring kafka 消费记录有一些延迟
- json - 如何在单击保存按钮时阻止 React 应用程序返回主页?
- javascript - vue动态图片绑定
- json - 从控制台运行代码时的 JSON 特殊字符
- html - 另一种转义浏览器地址栏的方法(弹出)