posted on 2024-11-02 14:29 read(813) comment(0) like(9) collect(3)
Table of contents
1. Uninstall Crypto and pycrypto libraries
2. Install the pycryptodome library
2. Another solution (I saw other people's problems, but I didn't encounter this situation)
The tutorial I searched online uses a third-party library to implement the AES algorithm . (The tutorial is linked here: Python implements AES encryption and decryption )
The first step is to install the pycryptodome module
After installing this module, an error is reported.
The specific error content is as follows:
- Traceback (most recent call last):
- File "E:\pythonProject\0000.py", line 1, in <module>
- from Crypto.Cipher import AES
- ModuleNotFoundError: No module named 'Crypto'
Many people may install Crypto using pip install which is incorrect for this library.
Need to install
pip install pycryptodome
If you have already installed the above pip install Crypto, you need to uninstall this library. Similarly, if you have installed other libraries from other posts, you need to uninstall them.
Then pip install pycryptodome
That is:
Uninstall Crypto and pycrypto library commands
- pip uninstall Crypto
- pip uninstall pycrypto
Next, install the third-party library pycryptodome (it seems to require Python3m)
pip install pycryptodome
Let's talk about the relationship between these three libraries:
crypto, pycrypto and pycrytodome are the same thing. The name of crypto in python is pycrypto. It is a third-party library and has stopped updating. What I understand is that pycrytodome is an upgraded version of the previous two.
Therefore, if you need the Crypto library, just use the command pip install pycryptodome
Note: When installing pycryptodome, this Crypto file will appear in the Python library file.
This solution still does not work.
In the project creation interface, I found that a check mark related to the third-party library was not checked. After checking it, there was no error.
The specific meaning is to copy a copy of the global package to the virtual environment to facilitate later project management and release. It is recommended to check it.
Then check it and the problem will be solved! If the error still occurs, it may be another problem.
Author:Disheartened
link:http://www.pythonblackhole.com/blog/article/245815/98bb847bef4314b0dc37/
source:python black hole net
Please indicate the source for any form of reprinting. If any infringement is discovered, it will be held legally responsible.
name:
Comment content: (supports up to 255 characters)
Copyright © 2018-2021 python black hole network All Rights Reserved All rights reserved, and all rights reserved.京ICP备18063182号-7
For complaints and reports, and advertising cooperation, please contact vgs_info@163.com or QQ3083709327
Disclaimer: All articles on the website are uploaded by users and are only for readers' learning and communication use, and commercial use is prohibited. If the article involves pornography, reactionary, infringement and other illegal information, please report it to us and we will delete it immediately after verification!