tuya-convert: ModuleNotFoundError: No module named 'Cryptodome'
When flashing a new device with
Starting smart config pairing procedure
Waiting for the device to install the intermediate firmware
Traceback (most recent call last):
File "./smartconfig/main.py", line 15, in <module>
from smartconfig import smartconfig
File "/home/fred/tuya-convert/scripts/smartconfig/smartconfig.py", line 43, in <module>
from multicast import multicast_head, encode_multicast_body
File "/home/fred/tuya-convert/scripts/smartconfig/multicast.py", line 12, in <module>
from Cryptodome.Cipher import AES
ModuleNotFoundError: No module named 'Cryptodome'
This is with the latest checkout (release v2.4.3) on my Raspberry Pi 4. I’ll try and fix the issue and report back.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 6
- Comments: 25
this help
sudo rm /usr/lib/python3.11/EXTERNALLY-MANAGED
I had this same issue, which was a result of installing the prerequisites as sudo - and then running start_flash.sh without sudo.
So to reword this - manually installing the prerequisites from install_prereq.sh without sudo fixed my issue (or running start_flash.sh with sudo).
had same issue
I have resolved my problem by 2 simple commands on pi:
after that you can check if module has been installed properly:
python3 -c 'from Cryptodome.Cipher import AES; print("Cryptodome works!")'The output should be:Cryptodome works!Then started flashing again and works fine
This worked for me
UPDATE: I’m getting a different error from
pi@octopi:~/tuya-convert/scripts/smartconfig $ python3 main.pyafter runningsudo pip3 install pycryptodomexand letting that install. I will try to reflash shortly because the error looks like the error is related to the AP not running. 🤞Sorry for some minor cross-posting, but this other thread was the second most promising: https://github.com/ct-Open-Source/tuya-convert/issues/643
2nd UPDATE: I noticed I still had the following errors in
smarthack-psk.logandsmarthack-web.logrespectively:Both appear to have been solved by running
sudo pip3 install sslpskandsudo pip3 install tornadorespectively and letting each finish installing before continuing on. I will try to reflash again, but I wanted to update my troubleshooting as I went. BTW, I still get the errorCommand "git clone -q https://github.com/drbild/sslpsk.git /tmp/pip-req-build-m7e4a1si" failed with error code 1 in Nonewhen I re-run./install_prereq.sh, but at least I’m not getting anymoreModuleNotFoundError: No module named 'sslpsk'errors in mysmarthack-psk.logfileNOTE: This may be an issue with trying to run
tuya-convertfrom a spare RPi running Octopi because I have found other threads of people having issues from this distribution - but it should theoretically be supported because Octopi is just a customized distro of Raspberry Pi OS which is itself a Debian distro, right?