DP-3T / reference_implementation

Apache License 2.0
127 stars 44 forks source link

ModuleNotFoundError: No module named 'Cryptodome' #1

Closed shreyas-badiger closed 4 years ago

shreyas-badiger commented 4 years ago

Unable to run example_run.py

Screenshot 2020-04-10 at 11 56 31 AM
gannimo commented 4 years ago

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!

shreyas-badiger commented 4 years ago

Thanks! The command is actually: pip3 install pycryptodomex

gannimo commented 4 years ago

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 :)

avandeursen commented 4 years ago

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

gannimo commented 4 years ago

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!

koenvervloesem commented 4 years ago

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

robin-shaun commented 3 years ago

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.

gannimo commented 2 years ago

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.