I am working on Pset 6, Sentiments and followed the steps to create my app on twitter.

I added keys, installed requirements.txt and did everything in order, but when I type "flask run" and visit the webserver, I am having the following error. What can I be doing wrong?

Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "/home/ubuntu/workspace/pset6/sentiments/application.py", line 3, 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
  • Are you on the current version of CS50 IDE (98 for me)? If not, try update50. Have you followed all the steps in the Getting Started, especially the first one?
    – Blauelf
    Feb 17, 2017 at 13:57
  • See if this post from reddit helps. [ie. adding --upgrade switch to pip3 command] Feb 17, 2017 at 14:55
  • Blauelf Yes, my version is also 98 and I tried the steps in pset guide, fortunately, DinoCoderSaurus 's link provides the solution. @DinoCoderSaurus Thank you, this solution worked. I had tried upgrading the components before but I now notice that I was using "--upgrade" switch incorrectly. If you add this as a response, I can choose as solution. Feb 17, 2017 at 20:51

1 Answer 1


This command pip3 install --user -r requirements.txt --upgrade solves the problem according to this post on reddit (and the comments here :).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .