hulalahei
V2EX  ›  问与答

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

  •  
  •   hulalahei · Mar 20, 2021 · 1080 views
    This topic created in 1970 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   ·   5656 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 01:46 · PVG 09:46 · LAX 18:46 · JFK 21:46
    ♥ Do have faith in what you're doing.