Originally using python 2.7.
Now using python 3.9.
Opening the existing file gives this error message:
ERROR: Could not find a version that satisfies the requirement dotnet (from versions: none)
ERROR: No matching distribution found for dotnet
Basic code that would produce this error:
import dotnet
print('dotnet is imported')
An attempt has been made here: ERROR: Could not find a version that satisfies the requirement dotnet
The solution in the above suggests that there is no support for 3.9 as per version support.
There is a package here: https://pypi.org/project/pythonnet/ but i have not tried this yet.
So there question is, are there alternative methods for getting the same working ?
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.