tgalal / yowsup

The WhatsApp lib
GNU General Public License v3.0
7.07k stars 2.23k forks source link

'cryptography.x509' has no attribute 'Certificate' (most likely due to a circular import) #3132

Open AHMEDLHASANI opened 2 years ago

AHMEDLHASANI commented 2 years ago

/storage/emulated/0/Android/data/ru.iiec.pydroid3/files $ yowsup-cli registration --requestcode sms --config-phone 2120603617113 --config-cc 212 --config-mcc 604 --config-mnc 05 sh: yowsup-cli: not found /storage/emulated/0/Android/data/ru.iiec.pydroid3/files $ python yowsup-cli registration --requestcode sms --config-phone 2120603617113 --config-cc 212 --config-mcc 604 --config-mnc 05 E 2022-04-08 13:06:46,541 yowsup.config.manager - Could not find a config for profile=2120603617113, paths checked: 2120603617113:/data/user/0/ru.iiec.pydroid3/app_HOME/.config/yowsup/2120603617113/config.yo:/data/user/0/ru.iiec.pydroid3/app_HOME/.config/yowsup/2120603617113/config.json Traceback (most recent call last): File "/storage/emulated/0/Android/data/ru.iiec.pydroid3/files/yowsup-cli", line 722, in if not parser.process(): File "/storage/emulated/0/Android/data/ru.iiec.pydroid3/files/yowsup-cli", line 387, in process self.handleRequestCode(self.args["requestcode"], config) File "/storage/emulated/0/Android/data/ru.iiec.pydroid3/files/yowsup-cli", line 396, in handleRequestCode from yowsup.registration import WACodeRequest File "/storage/emulated/0/Android/data/ru.iiec.pydroid3/files/yowsup/registration/init.py", line 1, in from .coderequest import WACodeRequest File "/storage/emulated/0/Android/data/ru.iiec.pydroid3/files/yowsup/registration/coderequest.py", line 1, in from yowsup.common.http.warequest import WARequest File "/storage/emulated/0/Android/data/ru.iiec.pydroid3/files/yowsup/common/http/init.py", line 2, in from .warequest import WARequest File "/storage/emulated/0/Android/data/ru.iiec.pydroid3/files/yowsup/common/http/warequest.py", line 9, in from cryptography.hazmat.primitives.ciphers.aead import AESGCM File "/storage/emulated/0/Android/data/ru.iiec.pydroid3/files/cryptography/hazmat/primitives/ciphers/aead.py", line 10, in from cryptography.hazmat.backends.openssl import aead File "/storage/emulated/0/Android/data/ru.iiec.pydroid3/files/cryptography/hazmat/backends/openssl/init.py", line 6, in from cryptography.hazmat.backends.openssl.backend import backend File "/storage/emulated/0/Android/data/ru.iiec.pydroid3/files/cryptography/hazmat/backends/openssl/backend.py", line 13, in from cryptography import utils, x509 File "/storage/emulated/0/Android/data/ru.iiec.pydroid3/files/cryptography/x509/init.py", line 6, in from cryptography.x509 import certificate_transparency File "/storage/emulated/0/Android/data/ru.iiec.pydroid3/files/cryptography/x509/certificate_transparency.py", line 10, in from cryptography.hazmat.bindings._rust import x509 as rust_x509 File "/storage/emulated/0/Android/data/ru.iiec.pydroid3/files/cryptography/hazmat/bindings/_rust/x509.py", line 8, in def load_pem_x509_certificate(data: bytes) -> x509.Certificate: ... AttributeError: partially initialized module 'cryptography.x509' has no attribute 'Certificate' (most likely due to a circular import)

Atique-Syed commented 1 year ago

I'm facing same issue. both the x509 folder/module in cryptography. and x509 py file in cryptography.hazmat.bindings._rust are calling each other. Can someone who resolved the issue please guide me here?