我正在学习有关使用Dash的教程,并尝试在此处找到示例代码:https://dash.plotly.com/layout
安装破折号并运行代码后,我在回溯中收到以下错误消息:
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.
我正在使用Windows 10,Python 3.8.5。这是到目前为止我根据网络搜索结果建议尝试的修复程序:
我绝对认为自己是新手,因此任何指导将不胜感激!
答案 0 :(得分:0)
就我而言,这有助于安装两个vc_redist
:
x86: vc_redist.x86.exe
x64: vc_redist.x64.exe
从这里 https://support.microsoft.com/en-gb/help/2977003/the-latest-supported-visual-c-downloads
另外,请确保将Python / Windows和其他软件更新到最新版本并重新启动计算机。
在Windows 10 Pro,Python 3.8.5,PyCharm 2020.2上进行了测试。
答案 1 :(得分:0)
使用--user
命令强制重新安装破折号:
pip install dash --force-reinstall --user