I was following this tutorial, and reached the section on using Fabric to deploy django projects. However when I run my fabfile.py I get this error. And here is my fabfile.py. For what i can deduce the Crypto library is missing, by I've tried pip install Crypto and still get the same error. Any suggestions? Thanks.
The Python "ModuleNotFoundError: No module named 'Crypto'" occurs when we forget to install the pycryptodome module before importing it or install it in an incorrect environment. To solve the error, install the module by running the pip install pycryptodome command.
PyCrypto is written and tested using Python version 2.1 through 3.3. Python 1.5. 2 is not supported. The modules are packaged using the Distutils, so you can simply run “python setup.py build” to build the package, and “python setup.py install” to install it.
It could be that when you installed it, it didn't compile all the necessary files. Try re-installing again. Make sure you see no errors, if you do you might be missing some development files/headers.
pip uninstall pycrypto
pip install pycrypto
You can just test it from the python shell:
python
Then:
>>> import Crypto
If you don't see any errors you are good.
If for some reason the module got compiled as crypto instead of Crypto on the Mac you can try:
>> import crypto
>> import sys
>> sys.modules['Crypto'] = crypto
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With