DP-3T/reference_implementation

ModuleNotFoundError: No module named 'Cryptodome'

shreyas-badiger opened this issue ยท 8 comments

Unable to run example_run.py

Screenshot 2020-04-10 at 11 56 31 AM

You need to install the Cryptodome library. You can do so through sudo apt install python3-pycryptodome, pip install pycryptodome or pip3 install pycryptodomex. I've updated the README accordingly. Thanks!

Thanks!
The command is actually:
pip3 install pycryptodomex

This depends on your local system. If you have both legacy python and python3 installed then pip installs for legacy, otherwise pip installs for python3. I'll make a note :)

I think @HARD-FAULT is referring not just to python3, but also to the x version of PyCryptodome.

pip install pycrotodomex works like a charm for me
pip install pycrotodome gives the ModuleNotFoundError

OK, I'll adjust. There are too many sub libraries and the different pip commands refer to different subsets of the library. Debian/Ubuntu conveniently installs both. Thanks!

Note that in a Python 3 virtual environment, you also need to install pycryptodomex instead of pycryptodome:

$ python3 -m venv venv
$ source venv/bin/activate
(venv) $ pip3 install pycryptodome
(venv) $ python3 example_run.py
Traceback (most recent call last):
File "example_run.py", line 23, in
import LowCostDP3T
File "/home/koan/reference_implementation/LowCostDP3T.py", line 20, in
from Cryptodome.Util import Counter
ModuleNotFoundError: No module named 'Cryptodome'
(venv) $ pip3 install pycryptodomex
(venv) $ python3 example_run.py
Day: Alice, Bob, and Isidor do not have contact.
Day: Alice, Bob, and Isidor do not have contact.
Day: Alice and Bob work in the same office, Isidor elsewhere.
Day: Alice and Bob work in the same office, Isidor elsewhere.
Day: Alice and Bob work in the same office, Isidor elsewhere.
Day: Bob and Isidor meet for dinner.
Isidor is tested positive.
Check exposure of Alice and Bob.
Alice: (not positive)
Bob: (at risk)
At risk, observed e91393fcf6d314d95ad607a1cbe00fa6 on day -1 for 121

I think @HARD-FAULT is referring not just to python3, but also to the x version of PyCryptodome.

pip install pycrotodomex works like a charm for me
pip install pycrotodome gives the ModuleNotFoundError

A spelling mistake, it's pycryptodomex.

Updated the comment to give options. Note that the README itself has much changed over time and this thread is likely no longer valid at all for this implementation.