dash-extensions icon indicating copy to clipboard operation
dash-extensions copied to clipboard

No module named 'dash_extensions.Download'

Open plasmapotential opened this issue 4 years ago • 2 comments

In the past I have used the following code to import the Download module:

from dash_extensions import Download

but now I am getting an error: ModuleNotFoundError: No module named 'dash_extensions.Download'

I do not see a Download module in the dash_extensions directory, or any of its .py files. Is this intentional? If so, how do I now access the Download features?

Thanks in advance

plasmapotential avatar May 03 '22 14:05 plasmapotential

I discovered that the features Download and send_file are now in the dcc module. So I went thru and replaced Download() with dcc.Download() and send_file() with dcc.send_file()

To clarify, I originally had:

from dash_extensions import Download
from dash_extensions.snippets import send_file

Download()
send_file()

and it should now be

from dash import dcc

dcc.Download()
dcc.send_file()

Sorry for the false alarm, but maybe this will be useful to someone.

plasmapotential avatar May 03 '22 14:05 plasmapotential

Jep, that's the recommended change. The component was in fact migrated to dcc a long time ago, but I kept it around for backwards compatibility. But with the 0.1.0 release, I decided it was time to allow some breaking changes, so it was removed.

emilhe avatar May 03 '22 15:05 emilhe