PiotrMachowski / Xiaomi-cloud-tokens-extractor

This tool/script retrieves tokens for all devices connected to Xiaomi cloud and encryption keys for BLE devices.
MIT License
3.17k stars 327 forks source link

Fails with ModuleNotFoundError: No module named 'Crypto' #113

Closed WeisseTeetasse closed 5 months ago

WeisseTeetasse commented 5 months ago

python3 token_extractor.py

Traceback (most recent call last): File "/root/crap/token_extractor/token_extractor.py", line 12, in from Crypto.Cipher import ARC4 ModuleNotFoundError: No module named 'Crypto'

Debian 12 arm64 Python 3.11.2

ii python3-requests 2.28.1+dfsg-1 all elegant and simple HTTP library for Python3, built for human beings ii python3-pycryptodome 3.11.0+dfsg1-4 arm64 cryptographic Python library (Python 3)

PiotrMachowski commented 5 months ago

Does pip install pycryptodome work?

WeisseTeetasse commented 5 months ago

Does pip install pycryptodome work?

I did not force it, since the debian package is installed.

pip3 install pycryptodome

error: externally-managed-environment

× This environment is externally managed ╰─> To install Python packages system-wide, try apt install python3-xyz, where xyz is the package you are trying to install.

If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.

For more information visit http://rptl.io/venv

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages. hint: See PEP 668 for the detailed specification.

PiotrMachowski commented 5 months ago

In what environment do you try to use this script?

WeisseTeetasse commented 5 months ago

In what environment do you try to use this script?

none/system Those are system packages.

PiotrMachowski commented 5 months ago

Potentially the best way to run this script would be to create a python virtual environment and manually run it inside

WeisseTeetasse commented 5 months ago

Potentially the best way to run this script would be to create a python virtual environment and manually run it inside

That works, thank you!