Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion - add a __version__ to annoy #572

Open
nlathia opened this issue Sep 10, 2021 · 0 comments
Open

Suggestion - add a __version__ to annoy #572

nlathia opened this issue Sep 10, 2021 · 0 comments

Comments

@nlathia
Copy link

nlathia commented Sep 10, 2021

馃憢 Hey folks, I was hoping to use annoy.__version__ to check which version of the Python Annoy library someone is using when uploading a model using modelstore. It doesn't appear to be supported and throws an AttributeError.

>>> import annoy
>>> annoy.__version__
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'annoy' has no attribute '__version__'

For now I'm falling back on one of the the (less common) approaches suggested here. If there's some scope to add that in (in the future), it would be great!

>>> import pkg_resources
>>> pkg_resources.get_distribution('annoy')
annoy 1.17.0 (/long/path/to/lib/python3.8/site-packages)
>>> pkg_resources.get_distribution('annoy').version
'1.17.0'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant