Odooers论坛

欢迎!

该社区面向专业人士和我们产品和服务的爱好者。
分享和讨论最好的内容和新的营销理念,建立您的专业形象,一起成为更好的营销人员。


0

How to fix No module named 'Crypto'?

1 备注
形象
丢弃
形象
odoo
-

Thank @ Surbhi Parmar share solution.

4 答案
0
形象
odoo
最佳答案

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
形象
odoo
最佳答案

You can fix the No module named 'Crypto' error by installing the correct package. Run pip install pycryptodome because the library is maintained under that name. Also ensure you’re using the right Python environment where the package is installed.

形象
丢弃
0
形象
odoo
最佳答案

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

形象
丢弃
0
形象
odoo
最佳答案

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 

形象
丢弃