question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ability to find pythonnet version at runtime / define __version__

See original GitHub issue

Details

  • 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:closed
  • Created a year ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
filmorcommented, Sep 17, 2022

@amueller Is this really necessary nowadays? Since Python 3.8, there is importlib.metadata.version which will work even when you just do python 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 to pkg_resources which introduces a runtime dependency on setuptools.

1reaction
filmorcommented, Sep 16, 2022

I’d like to adjust the build process to add a version to pythonnet directly, instead. To read the clr version, you have to have initialised the .NET runtime already.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found