配置 Python 以与本地部署机器人代理一起使用
说明
仅适用于使用本地部署机器人代理运行 ACL 机器人中的 ACL 脚本的组织。
订阅 ACL Robotics 专业版本的个人和组织没有本地部署机器人代理。
这些配置说明引用了客户安装的 Python 实例,该实例是使用 ACLScript Python 函数所必需的。此 Python 实例与可以作为机器人代理安装的一部分安装以支持机器学习命令 Python 实例不同。
这两个本地安装的 Python 实例都不能用于 HighBond 机器人或工作流机器人中的 Python/HCL 脚本编写。Diligent One 中的 Python/HCL 脚本编写严格基于云,不能在本地访问。
要配置 Python 以便与机器人代理一起使用,您必须安装兼容版本的 Python,并向服务器的 PATH 环境变量添加 Python 可执行文件。安装 PYTHON 后,设置 ACLPYTHONDLL 和PYTHONPATH 系统环境变量。
工作原理
要运行 Python 脚本,机器人代理必须能够调用 Python 可执行文件并找到它要按照指示运行的脚本。机器人代理使用 PATH 环境变量来查找 Python,使用 PYTHONPATH 环境变量来查找脚本。
安装 Python(32 位)
- From the Python downloads page, download one of the following versions of Python to your computer or the server:
- 3.7.x
- 3.8.x
- 3.9.x
Note
The listed versions of Python have been tested and verified to work with Analytics or the 机器人代理.
Any version of Python from 3.7.x onward should work.However, versions other than those listed are not guaranteed to work.
- On your computer or the server, double-click the installer.
- In the installer, select Add Python versionNumber to PATH.
- Click Install and follow the on-screen instructions.
- Reboot the computer or the server before running any Python scripts called by an Analytics script.
设置 ACLPYTHONDLL 和 PYTHONPATH 环境变量
- In the C:\ drive of the operating system, create one or more folders to house your Python scripts.
Example C:\python_scripts
- From the operating system, open the System Properties dialog box and click Environment Variables.
- In the System variables section, click New and enter the following variables:
Variable name Variable value PYTHONPATH The full path to the folder(s) you created to house the Python scripts.Separate multiple folder paths with a semi-colon.
Example:
C:\python_scripts;C:\dev;C:\tmp
ACLPYTHONDLL The full path and filename of the Python DLL file in the Python installation folder.
Example:
c:\python_install\python35.dll
Note
Upon installation, Python adds the DLL to the system folder (c:\windows\system32\python35.dll) rather than the installation folder.You must copy the DLL from the system folder to the installation folder, and use the installation folder location as the variable value.Analytics or the 机器人代理 look for the DLL in the Python installation folder.
You may also need to remove any read-only settings from the installation folder.
- To save the variable, click OK and then in the System Properties dialog box, click OK.