首先pyonnet安装要确保无误,不然会报OSError: cannot load library ''
;
当前版本是python39,此时pip install pythonnet
报错没有wheel, 需要自行下载,附上大多数wheel的下载链接https://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml 下载完成后pip install 路径+wheel名
。
因为我用到了pythonnet的import clr
;clr.AddReference('dll名')
且在打包完成后dist文件夹的exe同级目录没有这个dll,
所以报错System.IO.FileNotFoundException:Unable to find assembly 'XXX.dll'
。最后自行添加在同级目录即可。
Pyinstaller打包成使用了pyonnet包的exe时报错System.IO.FileNotFoundException:Unable to find assembly ‘XXX.dll‘。
最新推荐文章于 2024-07-02 09:03:44 发布