Plotly import error for exceptions module

2019-04-09 22:40发布

I have searched all over and couldn't find the solution to this problem. I am trying to import plotly in Jupyter Notebook with following code and getting the following error respectively

Code:

import sys
print(sys.path)
sys.path.append('/usr/local/lib/python2.7/dist-packages')

import plotly 

Error:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-3-b41540b5e198> in <module>()
      3 sys.path.append('/usr/local/lib/python2.7/dist-packages')
      4 
----> 5 import plotly

/usr/local/lib/python2.7/dist-packages/plotly/__init__.py in <module>()
     29 from __future__ import absolute_import
     30 
---> 31 from plotly import (plotly, dashboard_objs, graph_objs, grid_objs, tools,
     32                     utils, session, offline, colors)
     33 from plotly.version import __version__

/usr/local/lib/python2.7/dist-packages/plotly/plotly/__init__.py in <module>()
      8 
      9 """
---> 10 from . plotly import (
     11     sign_in,
     12     update_plot_options,

/usr/local/lib/python2.7/dist-packages/plotly/plotly/plotly.py in <module>()
     27 from requests.compat import json as _json
     28 
---> 29 from plotly import exceptions, files, session, tools, utils
     30 from plotly.api import v1, v2
     31 from plotly.plotly import chunked_requests

/usr/local/lib/python2.7/dist-packages/plotly/tools.py in <module>()
     14 import six
     15 
---> 16 from plotly import exceptions, optional_imports, session, utils
     17 from plotly.files import (CONFIG_FILE, CREDENTIALS_FILE, FILE_CONTENT,
     18                           check_file_permissions)

ImportError: cannot import name exceptions

What I Tried:

  • I have tried to upgrade plotly without any success.

  • Have uninstalled and reinstalled plotly package with pip, without any sucess

0条回答
登录 后发表回答