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.

cannot import name 'qualitative' from 'plotly.express.colors'

See original GitHub issue

Hi! 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:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
jonmmeasecommented, Jul 21, 2019

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 and conda. Try uninstalling and reinstalling like this.

$ pip uninstall plotly
$ conda uninstall plotly
$ conda install -c plotly plotly

If that doesn’t help, could you try installing plotly in a fresh conda environment?

$ conda create -n plotly_install -c plotly python=3.7 plotly=4.0
$ conda activate plotly_install
0reactions
chefcramercommented, Feb 1, 2022

Uninstalling and then reinstalling plotly worked for me too!

Read more comments on GitHub >

github_iconTop 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 >

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