plotly express error: cannot import name 'qualitative'
See original GitHub issueHi,
I’m trying to create a Choropleth map using plotly express. However when importing plotly express, I got an error:
code:
import plotly.express as px
error:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-39-86e89bd44552> in <module>
----> 1 import plotly.express as px
/opt/conda/envs/Python36/lib/python3.6/site-packages/plotly/express/__init__.py in <module>
13 )
14
---> 15 from ._imshow import imshow
16 from ._chart_types import ( # noqa: F401
17 scatter,
/opt/conda/envs/Python36/lib/python3.6/site-packages/plotly/express/_imshow.py in <module>
1 import plotly.graph_objs as go
2 from _plotly_utils.basevalidators import ColorscaleValidator
----> 3 from ._core import apply_default_cascade
4 import numpy as np
5
/opt/conda/envs/Python36/lib/python3.6/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 as pd
ImportError: cannot import name 'qualitative'
This issue is different from issue plotly #26793, plotly express #1672 and #123.
I have tried uninstalling plotly, both via pip
and conda
and reinstalling plotly version 4 as suggested at the main github page, pypi and plotly. However there is no success.
Just to be clear, I run an environment on cloud.IBM.com notebook, python 3.6, built-in plotly 3.6.1.
I have no further clue how to fix this, please provide some help. Any suggestion is appreciated.
Thanks, Hung
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
cannot import name 'qualitative' from 'plotly.express.colors'
Hi @AmazingSean, this error suggests that there may be something corrupt in the environment. This was also reported in plotly/plotly_express#123 ...
Read more >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 >Can't import plotly.express in .py script despite being installed
Your script is named plotly.py . When you run the script Python adds its directory to sys.path so import plotly imports the script....
Read more >How to Fix: No module named plotly - GeeksforGeeks
In this article, we are going to see how to fix the no module error of plotly. This type of error is seen...
Read more >plotly package — 5.11.0 documentation - Plotly Help Center
The 'type' property specifies the trace type (e.g. 'scatter', 'bar', 'area', etc.). If the dict has no 'type' property then 'scatter' is assumed....
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
i did what @nhohung suggested above and which worked for him but having to restart the kernel from the IBM Watson Notebook then fixed the issue.
THE BEST WAY You can install it in command line via pip:
pip install plotly
Or Install specific version:pip install "plotly==4.5.2"