小编use*_*091的帖子

pythonnet的构建轮失败

我正在尝试连接控制器以进行 python 实验。目前,这是我正在尝试运行的代码

import sys

print('adding location of IOPortClientLib.dll & Newport.CONEXAGP.CommandInterfacedll to sys.path')
sys.path.append(r'C:\Program Files\Newport\Piezo Motion Control\Newport CONEX-AGP Applet\Bin')

import clr
clr.AddReference('Newport.CONEXAGP.CommandInterface.dll')

Run Code Online (Sandbox Code Playgroud)

我得到两个不同的结果:

  1. 从 Ubuntu (WSL) 我得到
adding location of IOPortClientLib.dll & Newport.CONEXAGP.CommandInterfacedll to sys.path
Traceback (most recent call last):
  File "conex_test.py", line 7, in <module>
    clr.AddReference('Newport.CONEXAGP.CommandInterface.dll')
AttributeError: module 'clr' has no attribute 'AddReference'
Run Code Online (Sandbox Code Playgroud)
  1. 从 python3 IDLE,我得到
adding location of IOPortClientLib.dll & Newport.CONEXAGP.CommandInterfacedll to sys.path
Traceback (most recent call last):
  File "C:\Users\natal\Box Sync\Downer group (ndf367@eid.utexas.edu)\Sandia\code\python\conex_test.py", line 6, in <module>
    import …
Run Code Online (Sandbox Code Playgroud)

python pip

5
推荐指数
1
解决办法
2068
查看次数

标签 统计

pip ×1

python ×1