can't load matrix.py
bloosanbi opened this issue · 5 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?
I have similar error and cannot load matrix.py. This is being tracked in pyo3
at PyO3/pyo3#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
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)
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?
Well, seems like
OpenSSL
started to use Rust andPyO3
for their Python bindings. And you seem to be loading multiple WeeChat Python scripts which useOpenSSL
, whichPyO3
doesn't seem to support.I'm not sure that there's much we can do.
Hi @poljar So is this basically the question if Py03 starts supporting openssl or they don't? Or as well, if pyOpenSSL starts including another package than Py03? I'm just trying to understand the changes that were made and who made them upstream.. Or I guess if you support and include a different openssl package then pyOpenSSL in your code? Thanks for any insight..
On the README for pyOpenSSL it says Note: The Python Cryptographic Authority strongly suggests the use of [pyca/cryptography](https://github.com/pyca/cryptography) where possible. If you are using pyOpenSSL for anything other than making a TLS connection you should move to cryptography and drop your pyOpenSSL dependency.