V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
hulalahei
V2EX  ›  问与答

pycharm 2020.3 里面自带的 jupyter 使用 Javascript 报错 ReferenceError: require is not defined

  •  
  •   hulalahei · 2021-03-20 13:28:16 +08:00 · 533 次点击
    这是一个创建于 1137 天前的主题,其中的信息可能已经有所发展或是发生改变。

    from IPython.core.display import display, Javascript

    display( Javascript( """ require.config({ paths: { DT: '//cdn.datatables.net/1.10.20/js/jquery.dataTables.min', } }); $('head').append('<link rel="stylesheet" type="text/css" href="//cdn.datatables.net/1.10.20/css/jquery.dataTables.min.css">'); $('head').append('<style> td, th {{text-align: center;}}</style>') """ ) )

    这段代码在 chrome 里打开没啥问题,使用 pycharm 自带的 jupyter 就会报错。

    log 如下: 上午 10:59 Jupyter Javascript: ReferenceError: require is not defined

    上午 10:59 Jupyter Javascript: TypeError: Cannot read property 'config' of undefined: TypeError: Cannot read property 'config' of undefined

    这是 pycharm 自身的 bug 吗???谢谢各位老哥啦。

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2516 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 11:53 · PVG 19:53 · LAX 04:53 · JFK 07:53
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.