#17 importlib.find_module removed in Python 3.12, libray now errors on launch

已关闭
kerobaros8 月之前创建 · 4 条评论

I had libray installed inside an Ubuntu container using Python 3.10.2, and it worked perfectly. However, after installing libray with pip on my Fedora system with Python 3.12.2:

Traceback (most recent call last):
  File "/home/kerobaros/.local/bin/libray", line 27, in <module>
    from libray import core
  File "/home/kerobaros/.local/share/pipx/venvs/libray/lib/python3.12/site-packages/libray/__init__.py", line 31, in <module>
    _module = loader.find_module(module_name).load_module(module_name)
              ^^^^^^^^^^^^^^^^^^
AttributeError: 'FileFinder' object has no attribute 'find_module'

It appears that find_module was removed from importlib in Python 3.12. Here is a link to the 3.12 whatsnew discussing the removal. I believe the replacement for find_module is now importlib's find_spec.

I'm three sheets to the wind or else I'd start hacking on this myself. Please let me know if I can be of any assistance in the future.

I had libray installed inside an Ubuntu container using Python 3.10.2, and it worked perfectly. However, after installing libray with pip on my Fedora system with Python 3.12.2: ``` Traceback (most recent call last): File "/home/kerobaros/.local/bin/libray", line 27, in <module> from libray import core File "/home/kerobaros/.local/share/pipx/venvs/libray/lib/python3.12/site-packages/libray/__init__.py", line 31, in <module> _module = loader.find_module(module_name).load_module(module_name) ^^^^^^^^^^^^^^^^^^ AttributeError: 'FileFinder' object has no attribute 'find_module' ``` It appears that find_module was removed from importlib in Python 3.12. [Here is a link to the 3.12 whatsnew discussing the removal.](https://docs.python.org/3/whatsnew/3.12.html#importlib) I believe the replacement for find_module is now importlib's [find_spec](https://docs.python.org/3/library/importlib.html#importlib.machinery.FileFinder.find_spec). I'm three sheets to the wind or else I'd start hacking on this myself. Please let me know if I can be of any assistance in the future.
Nichlas Severinsen 评论于 8 月之前
所有者

Thank you very much for reporting, Archlinux is still on Python 3.11.7 so it's impressive that Fedora is on 3.12.2.

I'll see if I can fix it with a try/except.

I'm three sheets to the wind

Bahahah! Have a good one mate!

Tbh, I'm kind of thinking about moving away from Python if they are just going to break stuff repeatedly. This is like the 10th time something breaks for me because they're not ensuring backwards compatibility in new versions. It's a repeat of the whole Python2 vs Python3 ordeal, as if they didn't learn anything.

Thank you very much for reporting, Archlinux is still on Python 3.11.7 so it's impressive that Fedora is on 3.12.2. I'll see if I can fix it with a try/except. > I'm three sheets to the wind Bahahah! Have a good one mate! Tbh, I'm kind of thinking about moving away from Python if they are just going to break stuff repeatedly. This is like the 10th time something breaks for me because they're not ensuring backwards compatibility in new versions. It's a repeat of the whole Python2 vs Python3 ordeal, as if they didn't learn anything.
Nichlas Severinsen 在代码提交 8 月之前 中引用了该工单
Nichlas Severinsen 在代码提交 8 月之前 中引用了该工单
Nichlas Severinsen 在代码提交 8 月之前 中引用了该工单
Nichlas Severinsen 评论于 8 月之前
所有者

Hmm, okay I hope it works now. Feel free to test:

pipx install git+https://notabug.org/necklace/libray
Hmm, okay I hope it works now. Feel free to test: ``` pipx install git+https://notabug.org/necklace/libray ```
kerobaros 评论于 8 月之前
发布者

Works On My System (tm). Or at least it launches, I haven't tried to decrypt anything yet. Thanks for the quick turnaround!

Works On My System (tm). Or at least it launches, I haven't tried to decrypt anything yet. Thanks for the quick turnaround!
Nichlas Severinsen 在代码提交 8 月之前 中引用了该工单
Nichlas Severinsen 评论于 8 月之前
所有者

Of course, if you install that way you won't have any bundled keys. I recommend installing the PyPI version.

Either way, released 0.0.10 to fix this and a couple other issues, as well as more keys bundled and better game detection.

Of course, if you install that way you won't have any bundled keys. I recommend installing the PyPI version. Either way, released 0.0.10 to fix this and a couple other issues, as well as more keys bundled and better game detection.
登录 并参与到对话中。
未选择里程碑
未指派成员
2 名参与者
正在加载...
取消
保存
这个人很懒,什么都没留下。