DIAdem 初始化使用 Python 失敗

更新 Jan 3, 2025

產品資訊

軟體

  • DIAdem

程式語言

  • Python

問題敘述

我想透過 DIAdem 2020 中提供的 Python 安裝目錄將 Python 與 DIAdem 2020 一起使用,當我嘗試執行該腳本時,出現以下錯誤:

Initializing Python has failed

Error: Python is not initialized.

解決方案

  1. 確保 Python 位元數與 DIAdem 位元數匹配。 DIAdem 2019 及更高版本僅適用於 64 位元。
  2. 至少使用 Python 版本 3.7.xxx,請參考您使用的 DIAdem 版本的readme file以確認它支援哪個 Python 版本。
  3. 確保包含 Python 環境變數中的路徑。
  • 如果您希望 Python 跨多個使用者工作,請檢查 Python 目錄是否已增加到 PATH 中的User VariablesSystem Variables
  • 如果需要,手動增加/複製路徑。
  1. 確保 PYwin32 library已安裝在您計劃與 DIAdem 一起使用的 Python 版本上。
  2. 以管理員身份執行 DIAdem。
  3. 在DIAdem Settings增加Python引擎的目錄位置:
    1. 在 DIAdem 中,導航到Settings >> DIAdem Settings
  1. 點擊Panels 部份下的SCRIPT  ”。
  2. 選擇Python作為Script language
  3. 如果安裝不同版本的python,請輸入指向Python引擎的目錄位置作為Python安裝路徑。例如,SystemLink 附帶的標準 Python 引擎的路徑為: C:\Program Files\National Instruments\Shared\Skyline\Python\3.7\ *如果您使用預設 Python 版本,請將 Python 安裝路徑留空。

  1. 點擊“OK”
 
  1. 重啟DIAdem,使DIAdem Setting中的Python設定生效。
  2. DIAdem 現在可以執行 Python 腳本而不顯示任何錯誤。
 
 

相關資訊

DIAdem 2020 不支援虛擬 Python 環境,只有真正的 Python 引擎才會安裝到向作業系統註冊的專用目錄中。