ImportError: No module named Crypto, importerrorcrypto

Source: Internet
Author: User
Tags install homebrew

ImportError: No module named Crypto, importerrorcrypto

The beginning of the pit-the cause of the problem:
Run the python script. The prompt is:
ImportError: No module named Crypto
Cause:---the crypto library is missing (this library is imported through pyCharm, but it is still unavailable, so I want to use the pip3 command line to import it)
Start to solve the problem:
Step 1: Check the information online and install the python pycrypto library.
(1) to query the installation library, install pip first.
(2) pip installation statement:
A. install pip: it is recommended to install Homebrew and then brew install python

B, get home-brew: Command Line execution:/usr/bin/ruby-e "$ (curl-fsSL https://raw.githubusercontent.com/Homebrew/install/master/install )"
C. Execute the command line: brew install wget
D. Check pip again. The installation is successful.
(3) After pip is installed, the default value is python2.7. Currently, python3.6 is in use. You need to specify pip to install it to python3.6.
(4) run the command line to check the pip version, which is 9.0.1.
Link: https://www.zhihu.com/question/50470150? Sort = created
Link: http://brew.sh/index_zh-cn.html
Link: http://blog.csdn.net/jiandanjinxin/article/details/53175121
Step 2: Use pip to install the library
(1) first use statement: pip3 install git + https://github.com/RNCryptor/RNCryptor-python.git#egg=rncryptor
The following logs are always prompted:

It indicates that the current version of python3 is 8.1.1 and must be upgraded to 9.0.1. check it in pycharm.
Link: http://www.cnblogs.com/wayde-Z/p/6086083.html
(2) I started to upgrade pip and found the answer after n problems. You only need to execute: Execute
Pip3 install pymysql
An error is reported. The superior replied that the following code should be executed:
Pip3 install -- upgrade pip
Pip finally prompts that the upgrade and installation are successful. Next, use pip to install the library.
Step 3: Finally! I really want to start installing the pycrypto library with pip.
(1) execute the installation statement:
Pip3 install git + https://github.com/RNCryptor/RNCryptor-python.git#egg=rncryptor
Tip:
This prompt indicates that the library has been installed. Don't worry, continue to restart pycharm, re-run the program, or prompt that the Library is missing! Go to the python folder and find this library. In short, python3 cannot find this library.
(2) directly install the Library Based on the prompt log and run the following command line:
Pip3 install Crypto, or the above error is prompted
Continue execution: pip3 install pycrypto still prompts the above error
Link: http://www.cnblogs.com/xueranzp/p/5010893.html
Run the uninstall statement pip3 uninstall pycrypto directly. A message is displayed, indicating that the uninstall is successful !!
Run pip3 install pycrypto again to prompt that the installation is successful! Restart pycharm. Run the project and finally run it !!!

Related Article

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.