cannot import name 'qualitative' from 'plotly.express.colors'
See original GitHub issueHi! I am new to Dash and just installed plotly 4.0.0, where plotly.express is integrated. But I have some problem importing it.
When trying to run the example code:
import plotly.express as px
print(px.data.iris.__doc__)
px.data.iris().head()
I got this error:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-5-1979e3394739> in <module>
----> 1 import plotly.express as px
2 print(px.data.iris.__doc__)
3 px.data.iris().head()
~/anaconda3/lib/python3.7/site-packages/plotly/express/__init__.py in <module>
6 __version__ = "0.3.0"
7
----> 8 from ._chart_types import ( # noqa: F401
9 scatter,
10 scatter_3d,
~/anaconda3/lib/python3.7/site-packages/plotly/express/_chart_types.py in <module>
----> 1 from ._core import make_figure
2 from ._doc import make_docstring
3 import plotly.graph_objs as go
4
5
~/anaconda3/lib/python3.7/site-packages/plotly/express/_core.py in <module>
4
5 from _plotly_utils.basevalidators import ColorscaleValidator
----> 6 from .colors import qualitative, sequential
7 import math
8 import pandas
ImportError: cannot import name 'qualitative' from 'plotly.express.colors'
Is there anything I can do to solve it?
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Import plotly express error - Plotly Python
Error when importing express: import plotly.express as px. ImportError: cannot import name 'qualitative' from 'plotly.express.colors' ...
Read more >plotly cannot import name exceptions - python - Stack Overflow
I'm trying to import my module packages and I receive the error below. The strange thing is this was all working 2 days...
Read more >How to get names of all colorscales in Plotly-Python?
Step 2: Here we will get all the individual color-scale names by using the inspect module while iterating over the color module.
Read more >plotly package — 5.11.0 documentation - Plotly Help Center
Suppose we have a figure widget, fig , with a single trace. >>> import plotly.graph_objects as go >>> ...
Read more >Introducing Plotly Express - Medium
Plotly Express. The px.colors module contains a number of useful scales and sequences: qualitative, sequential, diverging, cyclical, and all your favourite ...
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
Hi @AmazingSean, this error suggests that there may be something corrupt in the environment. This was also reported in https://github.com/plotly/plotly_express/issues/123 and the problem went away after restarting the system.
First, make sure that you don’t have plotly installed with both
pip
andconda
. Try uninstalling and reinstalling like this.If that doesn’t help, could you try installing plotly in a fresh conda environment?
Uninstalling and then reinstalling plotly worked for me too!