干净地卸载损坏的jupyter nbextension

时间:2019-04-07 10:26:05

标签: jupyter-notebook ipython jupyter jupyter-contrib-nbextensions

前一段时间,我安装了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'

1 个答案:

答案 0 :(得分:1)

following the uninstall directions之后,我在我的virtualenv的根目录中运行了function bannerAdWidgetSetCarousal() { $('.clsBannerAds').each(function (index, element) { var columnCount = $(this).attr('data-columncount') || 1; var columnCntDesktopSmall = columnCount > 2 ? columnCount - 1 : columnCount; var columnCntTablet = columnCntDesktopSmall > 2 ? columnCntDesktopSmall - 1 : 1; var playInterval = $(this).attr('data-autoplayinterval') || false; var rowCount = $(this).attr('data-rowcount'); var displayMode = $(this).attr('data-displaymode'); var isDynamicDisplayMode = displayMode && displayMode == "Dynamic" ? true : false; var makeAnimate = isDynamicDisplayMode; var showNavigationArrow = !isDynamicDisplayMode ? true : false; var arrNavText = !isDynamicDisplayMode ? ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"] : ["", ""]; var slideItems = $(element).find('.item'); //THIS is code for make carosal slide in horizontal row, based on row count [ex. slides in 1 row, 2 row, 3 row] if (rowCount && rowCount > 1 && slideItems.length > 1) { var loopCount = Math.ceil(slideItems.length / rowCount); for (var i = 0; i < loopCount; i++) { var $el = $(element).find('.item:nth-of-type(' + (i + 1) + ')'); if ($el.next().length == 0) break; $el.next().find('.inner-item').appendTo($el); $el.next().remove(); } } //Init owlCarousel $(element).owlCarousel({ items: columnCount, lazyLoad: true, loop: true, autoPlay: playInterval, pagination: false, itemsDesktop: [1199, columnCount], itemsDesktopSmall: [979, columnCntDesktopSmall], itemsTablet: [768, columnCntTablet], itemsMobile: [479, 1], navigation: showNavigationArrow, navigationText: arrNavText, singleItem: makeAnimate, transitionStyle: "goDown" }); }); } ,发现了以下碎片:

grep -r beakerx *

我从上述文件中删除了有问题的行,并且错误消息消失了。

对于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