Merely importing plotly 3.6.0 causes error
See original GitHub issueI’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:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.1I downgraded to plotly 3.4.2 (since that was what your documentation was using) and that solved the problem. Thanks guys!
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.