cufflinks在pycharm中錯誤,在jupter notebook中正常


pycharm中錯誤顯示 AttributeError: module 'plotly.offline' has no attribute '__PLOTLY_OFFLINE_INITIALIZED'
求助大家!
非常感謝!
uj5u.com熱心網友回復:
改了下cufflinks庫中offline.py檔案,將go_offline最后一行縮進調一下:def go_offline(connected=None):
"""
connected : bool
If True, the plotly.js library will be loaded
from an online CDN. If False, the plotly.js library will be loaded locally
from the plotly python package
"""
from .auth import get_config_file
if connected is None:
try:
connected=True if get_config_file()['offline_connected'] is None else get_config_file()['offline_connected']
except:
connected=True
if run_from_ipython():
try:
py_offline.init_notebook_mode(connected)
except TypeError:
#For older versions of plotly
py_offline.init_notebook_mode()
py_offline.__PLOTLY_OFFLINE_INITIALIZED=True
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/109407.html
