【发布时间】:2020-06-28 01:25:57
【问题描述】:
我在使用 .dll 文件的代码中遇到了汇编错误。这是template code from another thread,很多人声称它有效。
import clr
import os
file = 'CPUThermometerLib.dll'
print('Does this filepath exist?',os.path.isfile(file))
clr.AddReference(file)
我猜文件路径没有问题,因为它在 .isfile 函数上返回 true。这是我得到的输出:
Does this filepath exist? True
File "<stdin>", line 1, in <module>
System.IO.FileNotFoundException: Unable to find assembly 'CPUThermometerLib.dll'.
at Python.Runtime.CLRModule.AddReference(String name)
我检查了多个线程,但没有一个给出解决方案。我使用的是 Windows 10,此外,我的 .NET 框架版本是“4.0.30319.42000”。我的笔记本电脑处理器是 Atom Z3537F。
【问题讨论】:
标签: python c windows cpu .net-assembly