weechat-matrix icon indicating copy to clipboard operation
weechat-matrix copied to clipboard

can't load matrix.py

Open bloosanbi opened this issue 1 year ago • 4 comments

python: loading script "/home/user/.weechat/python/matrix.py"
python: stdout/stderr (?): Traceback (most recent call last):
python: stdout/stderr (?):   File "/home/user/.weechat/python/matrix.py", line 43, in <module>
python: stdout/stderr (?):     import OpenSSL.crypto as crypto
python: stdout/stderr (?):   File "/home/user/.local/lib/python3.9/site-packages/OpenSSL/__init__.py", line 8, in <module>
python: stdout/stderr (?):     from OpenSSL import SSL, crypto
python: stdout/stderr (?):   File "/home/user/.local/lib/python3.9/site-packages/OpenSSL/SSL.py", line 9, in <module>
python: stdout/stderr (?):     from OpenSSL._util import (
python: stdout/stderr (?):   File "/home/user/.local/lib/python3.9/site-packages/OpenSSL/_util.py", line 6, in <module>
python: stdout/stderr (?):     from cryptography.hazmat.bindings.openssl.binding import Binding
python: stdout/stderr (?):   File
"/home/user/.local/lib/python3.9/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 15, in <module>
python: stdout/stderr (?):     from cryptography.exceptions import InternalError
python: stdout/stderr (?):   File "/home/user/.local/lib/python3.9/site-packages/cryptography/exceptions.py", line 9, in
<module>
python: stdout/stderr (?):     from cryptography.hazmat.bindings._rust import exceptions as rust_exceptions
python: stdout/stderr (?): ImportError: PyO3 modules may only be initialized once per interpreter process
python: unable to parse file "/home/user/.weechat/python/matrix.py"

Complete the installation and run /script load matrix.py, I got the following error. What should I do?

bloosanbi avatar Jul 25 '23 07:07 bloosanbi

Well, seems like OpenSSL started to use Rust and PyO3 for their Python bindings. And you seem to be loading multiple WeeChat Python scripts which use OpenSSL, which PyO3 doesn't seem to support.

I'm not sure that there's much we can do.

poljar avatar Jul 25 '23 08:07 poljar

I have similar error and cannot load matrix.py. This is being tracked in pyo3 at https://github.com/PyO3/pyo3/issues/576

My error is:

21:01 python: loading script "/mnt/wd1000/BTSync/RPi conf files/weechat/python/autoload/matrix.py"
21:01 python: stdout/stderr (?): Traceback (most recent call last):
21:01 python: stdout/stderr (?):   File "/mnt/wd1000/BTSync/RPi conf files/weechat/python/autoload/matrix.py", line 43, in <module>
21:01 python: stdout/stderr (?):     import OpenSSL.crypto as crypto
21:01 python: stdout/stderr (?):   File "/usr/lib/python3.12/site-packages/OpenSSL/__init__.py", line 8, in <module>
21:01 python: stdout/stderr (?):     from OpenSSL import SSL, crypto
21:01 python: stdout/stderr (?):   File "/usr/lib/python3.12/site-packages/OpenSSL/SSL.py", line 11, in <module>
21:01 python: stdout/stderr (?):     from OpenSSL._util import (
21:01 python: stdout/stderr (?):   File "/usr/lib/python3.12/site-packages/OpenSSL/_util.py", line 6, in <module>
21:01 python: stdout/stderr (?):     from cryptography.hazmat.bindings.openssl.binding import Binding
21:01 python: stdout/stderr (?):   File "/usr/lib/python3.12/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 15, in <module>
21:01 python: stdout/stderr (?):     from cryptography.exceptions import InternalError
21:01 python: stdout/stderr (?):   File "/usr/lib/python3.12/site-packages/cryptography/exceptions.py", line 9, in <module>
21:01 python: stdout/stderr (?):     from cryptography.hazmat.bindings._rust import exceptions as rust_exceptions
21:01 python: stdout/stderr (?): ImportError: PyO3 modules do not yet support subinterpreters, see https://github.com/PyO3/pyo3/issues/576

ikwyl6 avatar Sep 04 '24 00:09 ikwyl6

Getting the same traceback on a mostly fresh install on Ubuntu 22.04 in WSL (Python 3.10.12) (Same error on Ubuntu 24.04 LTS/Python 3.12.3)

nexy7574 avatar Sep 05 '24 16:09 nexy7574

I am also having this problem – does anyone know how I would find out whether I am

loading multiple WeeChat Python scripts which use OpenSSL

?

Because of the few Python scripts in the list of loaded scripts, none are particularly networky or anything beyond things like topicdiff, auto_away, etc.


Oooh wait, I'm dumb. I get a separate error when I first load the plugin, then when I reload it I get this error because it conflicts with itself – or something?

kqr avatar Sep 12 '24 09:09 kqr