question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Merely importing plotly 3.6.0 causes error

See original GitHub issue

I’ve got an issue with plotly version 3.6.0

Running import plotly gives me the following error in Spyder 3.2.4:

Traceback (most recent call last):

  File "<ipython-input-13-5fb02038c35f>", line 1, in <module>
    import plotly

  File "C:\Users\Artemis\Anaconda3\lib\site-packages\plotly\__init__.py", line 31, in <module>
    from plotly import (plotly, dashboard_objs, graph_objs, grid_objs, tools,

  File "C:\Users\Artemis\Anaconda3\lib\site-packages\plotly\plotly\__init__.py", line 10, in <module>
    from . plotly import (

  File "C:\Users\Artemis\Anaconda3\lib\site-packages\plotly\plotly\plotly.py", line 35, in <module>
    from plotly.graph_objs import Scatter

  File "C:\Users\Artemis\Anaconda3\lib\site-packages\plotly\graph_objs\__init__.py", line 82, in <module>
    from ._figurewidget import FigureWidget

  File "C:\Users\Artemis\Anaconda3\lib\site-packages\plotly\graph_objs\_figurewidget.py", line 12, in <module>
    class FigureWidget(BaseFigureWidget):

TypeError: function() argument 1 must be code, not str

Traceback (most recent call last):

  File "<ipython-input-13-5fb02038c35f>", line 1, in <module>
    import plotly

  File "C:\Users\Artemis\Anaconda3\lib\site-packages\plotly\__init__.py", line 31, in <module>
    from plotly import (plotly, dashboard_objs, graph_objs, grid_objs, tools,

  File "C:\Users\Artemis\Anaconda3\lib\site-packages\plotly\plotly\__init__.py", line 10, in <module>
    from . plotly import (

  File "C:\Users\Artemis\Anaconda3\lib\site-packages\plotly\plotly\plotly.py", line 35, in <module>
    from plotly.graph_objs import Scatter

  File "C:\Users\Artemis\Anaconda3\lib\site-packages\plotly\graph_objs\__init__.py", line 82, in <module>
    from ._figurewidget import FigureWidget

  File "C:\Users\Artemis\Anaconda3\lib\site-packages\plotly\graph_objs\_figurewidget.py", line 12, in <module>
    class FigureWidget(BaseFigureWidget):

TypeError: function() argument 1 must be code, not str

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
zeluspuddingcommented, Feb 4, 2019

Sorry for the delay - was away from computer. My version is Python 3.5.5 | packaged by conda-forge | (default, Jul 24 2018, 01:52:17) [MSC v.1900 64 bit (AMD64)] and ipywidgets 4.1.1

I downgraded to plotly 3.4.2 (since that was what your documentation was using) and that solved the problem. Thanks guys!

0reactions
jonmmeasecommented, Feb 4, 2019

Closed on the assumption that this is a problem with having ipywidgets v6 installed, which has been taken care of in #1425.

Please comment if removing ipywidgets or upgrading to v7 doesn’t fix the problem for you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ModuleNotFoundError: No module named 'plotly'
Just run this to uninstall plotly and then build it from source. That should fix the import pip uninstall plotly && python -m...
Read more >
Module Not Found Error for plotly - Plotly Python
Hi guys, I am getting Module not found error even though i install plotly and one more thing same thing happen with cufflinks....
Read more >
Troubleshooting in Python - Plotly
How to troubleshoot import and rendering problems in Plotly with Python. ... otherwise importing plotly can fail with mysterious error messages.
Read more >
Failure at the first hurdle - Python error on "import plotly"
Hi there, I've just started trying to use Plotly (and I'm a bit of a Python novice) following the instructions here: ...
Read more >
Error bars in Python - Plotly
Over 9 examples of Error Bars including changing color, size, log axes, and more in Python. ... import plotly.express as px df =...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found