在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:模块'clr'没有属性'AddReference'
删除第二行时,导入clr成功,因此找到了clr.pyd。
这是我当前安装的软件包:
astroid == 2.0.4
瓶== 0.12.13
certifi == 2018.10.15
chardet == 3.0.4
colorama == 0.3.9
柯南== 1.9.1
弃用== 2.0.6
distro == 1.1.0
紧固件== 0.14.1
未来== 0.16.0
idna == 2.7
isort == 4.3.4
lazy-object-proxy == 1.3.1
mccabe == 0.6.1
单调== 1.5
node-semver == 0.2.0
包装== 18.0
patch == 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