Question is identified as possible duplicate of IndexError in initial state of pset6 Sentiments, however, that question refers to an issue that's seen after running flask on unmodified distribution code and opening via web browser. If they are caused by same reason, this one can be closed but I cannot identify this.

When I try to import helpers. py in my code, I get the following error:

Traceback (most recent call last):
  File "./tweets", line 6, in <module>
    import helpers
  File "/home/ubuntu/workspace/pset6/sentiments/helpers.py", line 3, in <module>
    import plotly
  File "/home/ubuntu/.local/lib/python3.4/site-packages/plotly/__init__.py", line 31, in <module>
    from plotly import (plotly, graph_objs, grid_objs, tools, utils, session,
  File "/home/ubuntu/.local/lib/python3.4/site-packages/plotly/plotly/__init__.py", line 10, in <module>
    from . plotly import (
  File "/home/ubuntu/.local/lib/python3.4/site-packages/plotly/plotly/plotly.py", line 27, in <module>
    from plotly import exceptions, files, session, tools, utils
  File "/home/ubuntu/.local/lib/python3.4/site-packages/plotly/tools.py", line 60, in <module>
    matplotlylib = optional_imports.get_module('plotly.matplotlylib')
  File "/home/ubuntu/.local/lib/python3.4/site-packages/plotly/optional_imports.py", line 23, in get_module
    return import_module(name)
  File "/usr/lib/python3.4/importlib/__init__.py", line 109, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/home/ubuntu/.local/lib/python3.4/site-packages/plotly/matplotlylib/__init__.py", line 14, in <module>
    from plotly.matplotlylib.renderer import PlotlyRenderer
  File "/home/ubuntu/.local/lib/python3.4/site-packages/plotly/matplotlylib/renderer.py", line 13, in <module>
    import plotly.graph_objs as go
  File "/home/ubuntu/.local/lib/python3.4/site-packages/plotly/graph_objs/__init__.py", line 14, in <module>
    from plotly.graph_objs.graph_objs import *  # this is protected with __all__
  File "/home/ubuntu/.local/lib/python3.4/site-packages/plotly/graph_objs/graph_objs.py", line 34, in <module>
    from plotly import exceptions, graph_reference
  File "/home/ubuntu/.local/lib/python3.4/site-packages/plotly/graph_reference.py", line 232, in <module>
  File "/home/ubuntu/.local/lib/python3.4/site-packages/plotly/utils.py", line 492, in memoize
    return decorator(_memoize)
  File "/usr/lib/python3/dist-packages/decorator.py", line 213, in decorator
    fun = getfullargspec(callerfunc).args[0] # first arg
IndexError: list index out of range

I tried calling it from my program, like import helpers , from helpers import get_user_timeline and I even tried running Python console to run import helpers and get the same error in each and every time. I have checked other people's questions regarding to this Pset, but it seems it should do fine with import helpers. Did anyone have a similar issue?

  • Referred question is related to result of executing "flask run" and opening web browser in initial distribution code. This one just happens anywhere when I import helpers, like console or .py files. They might be caused by same reason but I cannot define it. Feb 17 '17 at 13:48
  • Both happen on import, and the stack traces look pretty much the same. Different causes seem unlikely to me.
    – Blauelf
    Feb 17 '17 at 14:55

Browse other questions tagged .