Pythonnet 缺少 AddReference 方法
Pythonnet missing AddReference method
在 Win10 1709 x64 PC 上,安装了 Python 3.7.4 64 位和 pythonnet-2.4.0-cp37-cp37m-win_amd64.whl。已确认 clr.pyd 和 Python.Runtime.dll 存在于:
C:\Users\me\AppData\Local\Programs\Python\Python37\Lib\site-packages\
放置在My.Assembly.dll中:
C:\Users\me\AppData\Local\Programs\Python\Python37\DLLs\
此脚本失败:
import clr
clr.AddReference("My.Assembly")
有错误:
AttributeError: module 'clr' has no attribute 'AddReference'
当我删除第 2 行时,导入 clr 成功,所以它找到了 clr.pyd。
这是我当前安装的软件包:
astroid==2.0.4
瓶子==0.12.13
证书==2018.10.15
chardet==3.0.4
colorama==0.3.9
柯南==1.9.1
弃用==2.0.6
发行版==1.1.0
紧固件==0.14.1
未来==0.16.0
idna==2.7
isort==4.3.4
惰性对象代理==1.3.1
mccabe==0.6.1
单调==1.5
节点语义版本==0.2.0
包装==18.0
补丁==1.16
pluginbase==0.7
Pygments==2.2.0
PyJWT==1.6.4
pylint==2.1.1
pyparsing==2.3.0
pythonnet==2.4.0
PyYAML==3.13
请求==2.20.1
六个==1.11.0
tqdm==4.28.1
urllib3==1.24.1
wrapt==1.10.11
在 Win10 1709 x64 PC 上,安装了 Python 3.7.4 64 位和 pythonnet-2.4.0-cp37-cp37m-win_amd64.whl。已确认 clr.pyd 和 Python.Runtime.dll 存在于:
C:\Users\me\AppData\Local\Programs\Python\Python37\Lib\site-packages\
放置在My.Assembly.dll中:
C:\Users\me\AppData\Local\Programs\Python\Python37\DLLs\
此脚本失败:
import clr
clr.AddReference("My.Assembly")
有错误:
AttributeError: module 'clr' has no attribute 'AddReference'
当我删除第 2 行时,导入 clr 成功,所以它找到了 clr.pyd。
这是我当前安装的软件包:
astroid==2.0.4
瓶子==0.12.13
证书==2018.10.15
chardet==3.0.4
colorama==0.3.9
柯南==1.9.1
弃用==2.0.6
发行版==1.1.0
紧固件==0.14.1
未来==0.16.0
idna==2.7
isort==4.3.4
惰性对象代理==1.3.1
mccabe==0.6.1
单调==1.5
节点语义版本==0.2.0
包装==18.0
补丁==1.16
pluginbase==0.7
Pygments==2.2.0
PyJWT==1.6.4
pylint==2.1.1
pyparsing==2.3.0
pythonnet==2.4.0
PyYAML==3.13
请求==2.20.1
六个==1.11.0
tqdm==4.28.1
urllib3==1.24.1
wrapt==1.10.11