تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
3 الردود
80970 أدوات العرض

hi,

I want to ask here I use the Crypto library to encode API authentication, here I have an error where "ModuleNotFoundError: No module named 'Crypto'", I have tried reinstalling pycryptodome but it's still the same. What should I do, is there any other way?


الصورة الرمزية
إهمال
أفضل إجابة

Hi,

you can try this code :

>> pip install pycryptodome

from Crypto.Cipher import AES  #Works

or

>> pip install pycryptodomex from Cryptodome.Cipher import AES 


Hope it helps

الصورة الرمزية
إهمال
أفضل إجابة

Last three days I was stuck there and what work for me I discover I have tow site-package folder in my project


The first under venv/lib

The second under venv/bin/python/lib

The library folder with the name crypto is in the first while it had to be in the second


To solve the problem I go to the interpreter setting where I Don,t found pycryptodome in the installed packages for sure and I used the plus in the corner to install it directly 

الصورة الرمزية
إهمال
أفضل إجابة

pip install pycryptodome

# for python 3 (could also be pip3.10 depending on your version)

pip3 install pycryptodome

# if you get permissions error

sudo pip3 install pycryptodome

pip install pycryptodome --user

# if you don't have pip in your PATH environment variable

python -m pip install pycryptodome

# for python 3 (could also be pip3.10 depending on your version)

python3 -m pip install pycryptodome

# using py alias (Windows)

py -m pip install pycryptodome


After you install the pycryptodome package, try importing it as follows

from Crypto.Cipher import AES

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
0
فبراير 24
1739
2
سبتمبر 24
2246
1
فبراير 24
3659
0
مايو 23
1871
2
مارس 24
2453