Py2exe Package Pycrypto Encryption module error problem
1. Foreword
Use Python to write a small tool, want to some files for encryption processing, write good source code use no problem, but want to package to the Windows system as a gadget to use. When you use Py2exe packaging, the Discovery program will always report an error loading the library in the _aes.py file. 2. Solutions 1.pycrypto pip installation problem
When you use Pip to install Pycrypto, you will always report one when you call in the program
From Crypto.cipher import AES
The problem of loading module errors, the solution found on the internet has two, Method 1
This error occurs because the library crypto file name case problem.
You can change the installed lowercase crpto to uppercase Crpto library Method 2
The second method is to uninstall the Crpto and install only the Pycrypto
Pip Uninstall crpto
pip uninstall pycrypto
pip install Pycrypto
_aes.py Load Module Error problem when 2.py2exe package Pycrypto
The main reason for this problem arises because we use
The PIP install Pycrypto or Easy_install Pycrypto is installed when the Pycrypto is installed. Egg the Library of the compression method, Py2exe does not unpack the. Egg compression Library When it is packaged, so there is a failure to find the library.
The workaround is to delete the Pycrypto. Egg library that has been installed. Using
Easy_install--always-unzip Pycrypto
To always install the Pycrypto library using the decompression method