Dash_table error in pycharm

I am using Python 3.7 and dash 1,8 and pycharm 2019.2.5 community edition, I am using following code given by your site

import dash
import dash_table
import pandas as pd

df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/solar.csv')

but I am getting following error

C:\ProgramData\Anaconda3\envs\nse1\python.exe C:/NSE/scripts/dash.py
Traceback (most recent call last):
  File "C:/NSE/scripts/dash.py", line 1, in <module>
    import dash
  File "C:\NSE\scripts\dash.py", line 2, in <module>
    import dash_table
  File "C:\ProgramData\Anaconda3\envs\nse1\lib\site-packages\dash_table\__init__.py", line 10, in <module>
    from ._imports_ import *
  File "C:\ProgramData\Anaconda3\envs\nse1\lib\site-packages\dash_table\_imports_.py", line 1, in <module>
    from .DataTable import DataTable
  File "C:\ProgramData\Anaconda3\envs\nse1\lib\site-packages\dash_table\DataTable.py", line 3, in <module>
    from dash.development.base_component import Component, _explicitize_args
ModuleNotFoundError: No module named 'dash.development'; 'dash' is not a package

Process finished with exit code 1

Pl help

Thanks & Regards

Hi @Parag welcome to the forum! It looks like you have incompatible versions of dash and dash_table, With recent versions of Dash, when you install the dash package it also installs other packages (dcc etc.), including dash_table. Could you maybe uninstall dash_table and dash, reinstall dash, and see if it works?

Hi

Thanks for your quick reply pl see the details below (as per URL https://dash.plot.ly/datatable

c:\temp>pip uninstall dash
Uninstalling dash-1.8.0:
  Would remove:
    c:\programdata\anaconda\lib\site-packages\dash-1.8.0.dist-info\*
    c:\programdata\anaconda\lib\site-packages\dash\*
    c:\programdata\anaconda\scripts\dash-generate-components.exe
    c:\programdata\anaconda\scripts\renderer.exe
Proceed (y/n)? y
  Successfully uninstalled dash-1.8.0

c:\temp>pip uninstall dash_table
Uninstalling dash-table-4.6.0:
  Would remove:
    c:\programdata\anaconda\lib\site-packages\dash_table-4.6.0.dist-info\*
    c:\programdata\anaconda\lib\site-packages\dash_table\*
Proceed (y/n)? y
  Successfully uninstalled dash-table-4.6.0

c:\temp>pip uninstall dash_html_components
Uninstalling dash-html-components-1.0.2:
  Would remove:
    c:\programdata\anaconda\lib\site-packages\dash_html_components-1.0.2.dist-info\*
    c:\programdata\anaconda\lib\site-packages\dash_html_components\*
Proceed (y/n)? y
  Successfully uninstalled dash-html-components-1.0.2


c:\temp>pip install dash==1.8.0
Processing c:\users\parag_ysz8lqe\appdata\local\pip\cache\wheels\ab\18\4f\810b70747c57b8dd0432a8801bd3a2f44bb7ed59a8b1947eca\dash-1.8.0-cp37-none-any.whl
Requirement already satisfied: plotly in c:\programdata\anaconda\lib\site-packages (from dash==1.8.0) (4.4.1)
Requirement already satisfied: future in c:\programdata\anaconda\lib\site-packages (from dash==1.8.0) (0.18.2)
Requirement already satisfied: Flask>=1.0.2 in c:\programdata\anaconda\lib\site-packages (from dash==1.8.0) (1.0.2)
Requirement already satisfied: flask-compress in c:\programdata\anaconda\lib\site-packages (from dash==1.8.0) (1.4.0)
Processing c:\users\parag_ysz8lqe\appdata\local\pip\cache\wheels\19\75\9b\3ee8716c87d804c80755616e09e2a845999ecd40ea70662e87\dash_table-4.6.0-cp37-none-any.whl
Processing c:\users\parag_ysz8lqe\appdata\local\pip\cache\wheels\59\6d\79\e8fbded6c6102c00ef0d58a278a488d913d30c51ae95dbef90\dash_html_components-1.0.2-cp37-none-any.whl
Requirement already satisfied: dash-renderer==1.2.3 in c:\programdata\anaconda\lib\site-packages (from dash==1.8.0) (1.2.3)
Requirement already satisfied: dash-core-components==1.7.0 in c:\programdata\anaconda\lib\site-packages (from dash==1.8.0) (1.7.0)
Requirement already satisfied: retrying>=1.3.3 in c:\programdata\anaconda\lib\site-packages (from plotly->dash==1.8.0) (1.3.3)
Requirement already satisfied: six in c:\users\parag_ysz8lqe\appdata\roaming\python\python37\site-packages (from plotly->dash==1.8.0) (1.11.0)
Requirement already satisfied: Jinja2>=2.10 in c:\programdata\anaconda\lib\site-packages (from Flask>=1.0.2->dash==1.8.0) (2.10)
Requirement already satisfied: Werkzeug>=0.14 in c:\programdata\anaconda\lib\site-packages (from Flask>=1.0.2->dash==1.8.0) (0.14.1)
Requirement already satisfied: click>=5.1 in c:\programdata\anaconda\lib\site-packages (from Flask>=1.0.2->dash==1.8.0) (7.0)
Requirement already satisfied: itsdangerous>=0.24 in c:\programdata\anaconda\lib\site-packages (from Flask>=1.0.2->dash==1.8.0) (1.1.0)
Requirement already satisfied: MarkupSafe>=0.23 in c:\programdata\anaconda\lib\site-packages (from Jinja2>=2.10->Flask>=1.0.2->dash==1.8.0) (1.1.1)
Installing collected packages: dash-table, dash-html-components, dash
Successfully installed dash-1.8.0 dash-html-components-1.0.2 dash-table-4.6.0

c:\temp>pip install dash_renderer
Requirement already satisfied: dash_renderer in c:\programdata\anaconda\lib\site-packages (1.2.3)

In PyCharm after installing dash package

File->Settings-Project Settings it is showing

|dash|1.4.1|1.4.1|
|---|---|---|
|dash-core-components|1.3.1|1.3.1|
|dash-html-components|1.0.1|1.0.1|
|dash-renderer|1.1.2|1.1.2|
|dash-table|4.4.1|4.4.1|

And still giving following error

C:\ProgramData\Anaconda3\envs\nse1\python.exe C:/NSE/scripts/dash.py
Traceback (most recent call last):
  File "C:/NSE/scripts/dash.py", line 1, in <module>
    import dash
  File "C:\NSE\scripts\dash.py", line 2, in <module>
    import dash_table
  File "C:\ProgramData\Anaconda3\envs\nse1\lib\site-packages\dash_table\__init__.py", line 10, in <module>
    from ._imports_ import *
  File "C:\ProgramData\Anaconda3\envs\nse1\lib\site-packages\dash_table\_imports_.py", line 1, in <module>
    from .DataTable import DataTable
  File "C:\ProgramData\Anaconda3\envs\nse1\lib\site-packages\dash_table\DataTable.py", line 3, in <module>
    from dash.development.base_component import Component, _explicitize_args
ModuleNotFoundError: No module named 'dash.development'; 'dash' is not a package

Pl help

Thanks

As you can see from the list of package versions dash 1.4.1 is used, not 1.8.0. Maybe you need to pip uninstall dash several times in a row to be sure that all versions have been uninstalled (maybe do the same with conda if you have been using both conda and pip), and also make sure to uninstall dash_table, dash-core-components, dash-renderer and dash-html-components. Installing dash 1.8.0 should install all packages, but you first need to uninstall all the old versions (pip will display an error when asking to remove a package which is not installed, so this is one way to know that the uninstall was complete).

Are you uninstalling/installing Dash outside of any virutal environment used in pycharm? This could explain the diff in versions.

Thanks issue has been resolved as created new project in Pycharm, sorry for delayed reply