python3.X program running error Traceback (most recent call last) ModuleNotFoundError: No module named'Crypto' solution


Dingdu! Here is the compilation of Xiao Ah Woo's study course materials. A good memory is not as good as a bad pen. Today is also a day to make progress. Let's advance together!
Insert picture description here

1. Problem description

When using Python's third-party library, Crypto, when running the program, an error appears:

Traceback (most recent call last):
  File "D:/WorkingLocation/PyCharmProjects/test1/DigitalSignatureAlgorithm.py", line 2, in <module>
    from Crypto.Hash import SHA
ModuleNotFoundError: No module named 'Crypto'

Insert picture description here
About the project code:

Insert picture description here
Part of debugging information:

Insert picture description here
Insert picture description here

2. Try to solve the problem:

1. The first thing that comes to mind is to install the third-party library Crypto [practice here is not feasible]

打开Terminal
然后执行命令:pip install Crypto

Insert picture description here

发现已经成功安装了,但是项目运行还是出错。

Insert picture description here
Later, I tried to install pycrypto and found that the problem could not be solved:

2. Uninstall Crypto and pycrypto first, install the third-party library pycryptodome [practice is not feasible here]

Uninstall Crypto and pycrypto first

pip uninstall Crypto
pip uninstall pycrypto

Insert picture description here

Then install the third-party library pycryptodome

pip install pycryptodome

Insert picture description here

3. The final solution [practical feasible]

Find the storage path of crypto and modify the folder name crypto to Crypto.

Insert picture description here
Here~ It
runs successfully!

Insert picture description here
Insert picture description here

Ending!
More course knowledge learning records will come later!

就酱,嘎啦!

Insert picture description here

Note:
1. Life is diligent, nothing is gained.
2. The
final solution for ModuleNotFoundError: No module named'Crypto' can be found in the blog post: https://www.cnblogs.com/tanghuang/p/9869092.html

Guess you like

Origin blog.csdn.net/qq_43543789/article/details/109235529