hulalahei
V2EX  ›  问与答

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

  •  
  •   hulalahei · Mar 20, 2021 · 1055 views
    This topic created in 1943 days ago, the information mentioned may be changed or developed.

    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 吗???谢谢各位老哥啦。

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5388 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 03:44 · PVG 11:44 · LAX 20:44 · JFK 23:44
    ♥ Do have faith in what you're doing.