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

クローズ
8 ヶ月 前kerobaros によって開かれました · 4 コメント
kerobaros8 ヶ月 前 にコメントしました

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 Severinsen8 ヶ月 前 にコメントしました
オーナー

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 Severinsen8 ヶ月 前 にコメントしました
オーナー

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 ```
kerobaros8 ヶ月 前 にコメントしました
ポスター

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 Severinsen8 ヶ月 前 にコメントしました
オーナー

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.
necklace 8 ヶ月 前 に閉じられました
会話に参加するには サインイン してください。
マイルストーンなし
担当者なし
2 参加者
読み込み中…
キャンセル
保存
まだコンテンツがありません