issue_comments: 1503833906
This data as json
html_url | issue_url | id | node_id | user | created_at | updated_at | author_association | body | reactions | issue | performed_via_github_app |
---|---|---|---|---|---|---|---|---|---|---|---|
https://github.com/simonw/datasette/issues/2057#issuecomment-1503833906 | https://api.github.com/repos/simonw/datasette/issues/2057 | 1503833906 | IC_kwDOBm6k_c5Zoq8y | 9599 | 2023-04-11T17:44:16Z | 2023-04-11T17:45:45Z | OWNER | Another prompt: > How to fix this: > > `pkg_resources.get_distribution(package).version` Response: <img width="641" alt="image" src="https://user-images.githubusercontent.com/9599/231245559-dd943527-818a-45aa-9833-b9db8c7ca87e.png"> ```python import importlib.metadata # Get the version number of the specified package package_version = importlib.metadata.version(package) ``` That seems to work: ```pycon >>> import importlib.metadata >>> importlib.metadata.version("datasette") '0.64.2' >>> importlib.metadata.version("pluggy") '1.0.0' >>> importlib.metadata.version("not-a-package") ... importlib.metadata.PackageNotFoundError: No package metadata was found for not-a-package ``` | {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} | 1662951875 |