[英]Error when importing Dash: "ImportError: DLL load failed while importing _brotli: The specified module could not be found."
I'm following the tutorial on using Dash and trying the sample code found here: https://dash.plotly.com/layout我正在按照有关使用 Dash 的教程并尝试在此处找到的示例代码: https://dash.plotly.com/layout
After installing dash and running the code, I get the following error message in the traceback:安装 dash 并运行代码后,我在回溯中收到以下错误消息:
Traceback (most recent call last):
File "app_example.py", line 7, in <module>
import dash
File "C:\Users\lizsc\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\dash\__init__.py", line 1, in <module>
from .dash import Dash, no_update # noqa: F401
File "C:\Users\lizsc\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\dash\dash.py", line 18, in <module>
from flask_compress import Compress
File "C:\Users\lizsc\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\flask_compress.py", line 10, in <module>
import brotli
File "C:\Users\lizsc\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\brotli.py", line 8, in <module>
import _brotli
ImportError: DLL load failed while importing _brotli: The specified module could not be found.
I'm using Windows 10, Python 3.8.5.我正在使用 Windows 10、Python 3.8.5。 Here are the fixes I've tried so far based on web search result recommendations:
以下是我迄今为止根据 web 搜索结果建议尝试过的修复方法:
I definitely consider myself a novice, so any guidance would be appreciated!我绝对认为自己是新手,所以任何指导将不胜感激!
In my case helped installing both vc_redist
:在我的例子中,帮助安装了两个
vc_redist
:
x86: vc_redist.x86.exe
x64: vc_redist.x64.exe
from here https://support.microsoft.com/en-gb/help/2977003/the-latest-supported-visual-c-downloads从这里https://support.microsoft.com/en-gb/help/2977003/the-latest-supported-visual-c-downloads
Additionally make sure that you updated Python/Windows and other software to newest versions and restarted machine.此外,请确保将 Python/Windows 和其他软件更新到最新版本并重新启动机器。
Tested on Windows 10 Pro, Python 3.8.5, PyCharm 2020.2.在 Windows 10 Pro、Python 3.8.5、PyCharm 2020.2 上测试。
In my case (windows 10 pro), I installed 'vc_redist.x64.exe'.就我而言(Windows 10 专业版),我安装了“vc_redist.x64.exe”。 you can click here for link to try for your device
您可以单击此处获取链接以试用您的设备
Force reinstall dash using --user
command:使用
--user
命令强制重新安装破折号:
pip install dash --force-reinstall --user
In my case, I had a problem with the module of dash named "Derkzeug".就我而言,名为“Derkzeug”的破折号模块有问题。 I followed the next steps:
我遵循了以下步骤:
pip list -> To verify the version
pip install Werkzeuk==2.0.0 -> To downgrade the version of the module
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.