![](/img/trans.png)
[英]Error when importing Dash: "ImportError: DLL load failed while importing _brotli: The specified module could not be found."
[英]Workaround for “ImportError: DLL load failed while importing mariadb: The specified module could not be found.”
在使用 Python 3.8.3 在 Windows 64 位上安装 MariaDB 连接器/Python 后,我在import mariadb
时收到以下错误
ImportError: DLL load failed while importing mariadb: The specified module could not be found.
显然这是一个已知问题。 请您帮我找到解决方法,直到问题得到解决?
venv\app_name\Lib\site-packages\mariadb-0.9.58.dist-info
产生以下结果:
2020-05-25 16:41 4 INSTALLER
2020-05-25 16:41 27,030 LICENSE
2020-05-25 16:41 2,625 METADATA
2020-05-25 16:41 572 RECORD
2020-05-25 16:41 8 top_level.txt
2020-05-25 16:41 105 WHEEL
6 File(s) 30,344 bytes
显然它看起来不是很多有用的东西,因为没有 Python 或 C/C++ 模块。 所以也许用pip3 install --pre mariadb
失败了(尽管它报告成功)。
我想到了以下候选解决方案:
显然,最快和最可靠的解决方案(据我所知)是按照 wiki 中的步骤从源代码构建 MariaDB Connector/Python,特别是安装了 MSVS 2019 和 MariaDB Connector/C,我在虚拟环境命令行:
set MARIADB_CC_INSTALL_DIR="C:\Program Files\MariaDB\MariaDB Connector C 64-bit"
python setup.py build
python setup.py install
这个错误是由一个小错字引起的,而不是静态链接,MariaDB Connector/C 是动态链接的,但 libmariadb.dll 无法加载。
实际上有3个选项:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.