You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I installed hail into an empty, new Python 3.12.2 virtual environment, and was not able to import it. I see a failure like this:
(venv) (py312) alex@rpi400:~/hail $ python
Python 3.12.2 | packaged by conda-forge | (main, Feb 16 2024, 20:38:53) [GCC 12.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import hail
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/alex/hail/venv/lib/python3.12/site-packages/hail/__init__.py", line 2, in <module>
import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'
It looks like in Python 3.12, the bundled setuptools was removed and new virtual environments will not have setuptools in them, it needs to be specifically installed through pip: python/cpython#95299
This could be fixed either by adding setuptools to hail's requirements so that it will be installed when users install hail, or hail could remove usage of setuptools & its associated modules (pkg_resources) at runtime, as some other projects have done: TDAmeritrade/stumpy#950
I also have to admit that I discovered this while playing around with hail on a Raspberry Pi 4, so it is possible that something else broken caused this failure, but I believe I understand what's happening. Here's my full pip freeze for reference:
What happened?
Hello,
I installed hail into an empty, new Python 3.12.2 virtual environment, and was not able to import it. I see a failure like this:
It looks like in Python 3.12, the bundled setuptools was removed and new virtual environments will not have setuptools in them, it needs to be specifically installed through pip: python/cpython#95299
This could be fixed either by adding
setuptools
to hail's requirements so that it will be installed when users install hail, or hail could remove usage of setuptools & its associated modules (pkg_resources
) at runtime, as some other projects have done: TDAmeritrade/stumpy#950At a glance, the cleanest thing to do here may be to move off of the deprecated
pkg_resources
and to the recommendedimportlib
if it has what you need: https://setuptools.pypa.io/en/latest/pkg_resources.htmlI also have to admit that I discovered this while playing around with hail on a Raspberry Pi 4, so it is possible that something else broken caused this failure, but I believe I understand what's happening. Here's my full
pip freeze
for reference:Version
0.2.128
Relevant log output
No response
The text was updated successfully, but these errors were encountered: