简体   繁体   English

python4delphi使用的安装Python的哪个部分?

[英]What part of installed Python does python4delphi use?

I have Python 2.7 installed in "C:\\Python27". 我在“C:\\ Python27”中安装了Python 2.7。 Now I run 1st demo of Python4delphi with D7, which somehow uses my Py2.7 install folder. 现在我用D7运行Python4delphi的第一个演示,它以某种方式使用我的Py2.7安装文件夹。 If I rename Python folder, demo can't run (without error message). 如果我重命名Python文件夹,则无法运行demo(没有错误消息)。 I didn't change properties of a demo form. 我没有更改演示表单的属性。

What part/file does py4delphi use from my Python folder? py4delphi在我的Python文件夹中使用了哪些部分/文件?

python4delphi is a loose wrapper around the Python API and as such relies on a functioning Python installation. python4delphi是一个围绕Python API的松散包装器,因此依赖于正常运行的Python安装。 Typically on Windows this comprises at least the following: 通常在Windows上,这至少包括以下内容:

  • The main Python directory. 主要的Python目录。 On your system this is C:\\Python27. 在您的系统上,这是C:\\ Python27。
  • The Python DLL which is python27.dll and lives in your system directory. Python DLL是python27.dll,存在于您的系统目录中。
  • Registry settings that indicate where your Python directory is installed. 注册表设置,指示Python目录的安装位置。

When you rename the Python directory, the registry settings refer to a location that no longer exists. 重命名Python目录时,注册表设置引用不再存在的位置。 And so the failure you observe is entirely to be expected. 所以你观察到的失败完全是预料之中的。


Perhaps you are trying to work out how to deploy your application in a self-contained way without requiring an external dependency on a Python installation. 也许您正试图找出如何以自包含的方式部署应用程序,而无需对Python安装进行外部依赖。 If so, then I suggest you look in to one of the portable Python distributions. 如果是这样,那么我建议你查看一个可移植的Python发行版。 You may need to adapt python4delphi a little to find the Python DLL which will be located under your application's directory. 您可能需要稍微调整python4delphi以找到将位于应用程序目录下的Python DLL。 But that should be all that's needed. 但这应该是所有需要的。 Take care of the licensing issues too if you do distribute Python with your application. 如果您使用应用程序分发Python,也要处理许可问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM