You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何安装Delphi for Python?导入DelphiVCL时DLL加载失败

DelphiVCL导入时DLL加载失败的原因及解决办法

执行操作及安装结果:

pip install delphivcl
Collecting delphivcl
  Using cached delphivcl-0.1.24-cp311-cp311-win_amd64.whl
Installing collected packages: delphivcl
Successfully installed delphivcl-0.1.24

导入时触发错误:

Python 3.11.0 (main, Oct 24 2022, 18:26:48) [MSC v.1933 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from delphivcl import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Program Files\Python311\Lib\site-packages\delphivcl\__init__.py", line 22, in <module>
    package = new_import()
              ^^^^^^^^^^^^
  File "C:\Program Files\Python311\Lib\site-packages\delphivcl\__init__.py", line 15, in new_import
    ld = loader.create_module(spec)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: DLL load failed while importing DelphiVCL: The specified module could not be found.

可能的问题及解决方式:

  • 缺少Delphi运行时依赖:DelphiVCL依赖Embarcadero Delphi的运行时DLL(如对应版本的vclXXX.bpl),若系统未安装Delphi,或未将Delphi安装目录下的bin路径加入系统PATH环境变量,就会触发加载失败。解决:安装对应版本的Delphi,或手动把Delphi的bin目录路径添加到PATH。
  • 版本不兼容:你使用的Python 3.11与安装的delphivcl 0.1.24可能存在适配问题。解决:要么将Python降级到3.10,要么执行pip install --upgrade delphivcl更新到最新版本。
  • 位数不匹配:安装的是64位delphivcl,但如果Python是32位,或Delphi运行时是32位,就会出现不兼容。解决:确认Python、DelphiVCL、Delphi运行时三者的位数完全一致(均为64位或均为32位)。
  • 安装包损坏:缓存的安装包可能存在损坏。解决:执行pip install --no-cache-dir delphivcl清除缓存后重新安装。

内容的提问来源于stack exchange,提问作者zac

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.09 18:10:50