How to fix tuya-convert ModuleNotFoundError: No module named 'Cryptodome'
Problem:
While trying to flash a device using tuya-convert, you see an error message like
======================================================
Starting smart config pairing procedure
Waiting for the device to install the intermediate firmware
Traceback (most recent call last):
File "/home/pi/tuya-convert/scripts/./smartconfig/main.py", line 15, in <module>
from smartconfig import smartconfig
File "/home/pi/tuya-convert/scripts/smartconfig/smartconfig.py", line 43, in <module>
from multicast import multicast_head, encode_multicast_body
File "/home/pi/tuya-convert/scripts/smartconfig/multicast.py", line 12, in <module>
from Cryptodome.Cipher import AES
ModuleNotFoundError: No module named 'Cryptodome'
.........................................
and the flash procedure fails.
Solution
The current version of ./install_reqs.sh
does not install the pycryptodome
module. Install it manually using
sudo -H python3 -m pip install --upgrade pycryptodome