首页 > 解决方案 > 错误:未找到 dotnet 的匹配分布

问题描述

最初使用python 2.7. 现在使用python 3.9.

打开现有文件会给出以下错误消息:

ERROR: Could not find a version that satisfies the requirement dotnet (from versions: none)
ERROR: No matching distribution found for dotnet

会产生此错误的基本代码:

import dotnet
print('dotnet is imported')

此处已尝试: 错误:找不到满足dotnet要求的版本

上面的解决方案表明不支持3.9按版本支持。

这里有一个包:https ://pypi.org/project/pythonnet/但我还没有尝试过。

所以有一个问题,是否有其他方法可以使相同的工作?

标签: python.netpython-3.9

解决方案


If you look at the dotnet PyPI page under "Download files", you'll see that they only have wheels for Python 2.7 and 3.6. There isn't even a link to a source code .zip or .tar.gz file. The module's BitBucket link is dead. I found this on Github, but I didn't try to build it, as I don't have Visual Studio installed. YMMV.

As far as pythonnet is concerned, they currently only have wheels up to Python 3.8, even though the 3.0 development branch builds successfully on Appveyor with 3.9. You can try grabbing a wheel from here (temporary link, will be deleted after 1 month per Appveyor's policy). I have not tried this path, so again YMMV. Downgrading to Python 3.8 is always an option.

Finally, you can open an issue or find an existing one to lobby for a 3.9 wheel release.


推荐阅读