Py2exe Packaging Pycrypto Encryption module Error reason

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.