Ability to find pythonnet version at runtime / define __version__
See original GitHub issueDetails
- I would like to be able to find out which version of pythonnet is installed in a particular runtime environment from the python side. Most packages define a
package.__version__
for that purpose. I couldn’t find anything like that in pythonnet.
I tried
print(pythonnet.__version__)
print([v for v in dir(pythonnet) if "version" in v])
I checked on pythonnet==3.0.0rc4.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Developers - Ability to find pythonnet version at runtime / define ...
Details. I would like to be able to find out which version of pythonnet is installed in a particular runtime environment from the...
Read more >Embedding .NET into Python - Python.NET documentation
While Python.NET will generally be able to figure out the right version of an overloaded method to call automatically, there are cases where...
Read more >How to fix error during pythonnet installation
So, the command line should be: python -m pip install --pre pythonnet . Or specify the version directly: pip install pythonnet==3.0.0rc6 .
Read more >pythonnet Embedding Python in .net example failing to ...
I have used Anaconda to install python runtime and packages. Note that default Anaconda installation is under C:\Users(your username assigned in ...
Read more >pythonnet 3.0.1
pythonnet is a package that gives .NET programmers ability to integrate Python engine and use Python libraries. Embedding Python in .NET. You must...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@amueller Is this really necessary nowadays? Since Python 3.8, there is
importlib.metadata.version
which will work even when you just dopython setup.py build
in the local checkout. In the end, I would just use this one to define__version__
as well, just on 3.7 we’d need to fall back topkg_resources
which introduces a runtime dependency onsetuptools
.I’d like to adjust the build process to add a version to
pythonnet
directly, instead. To read theclr
version, you have to have initialised the .NET runtime already.