Explanation of the reason why Importerror:no module named Crypto is prompted when importing modules in Python

Source: Internet
Author: User
Tags install homebrew
The beginning of the pit-the cause of the problem:
To run a python script, tip:
Importerror:no module named Crypto
Reason:---missing crypto library (imported by Pycharm tool, but still not available, so you want to import with PIP3 command line)
Start settlement Pit:
Step One: Surf the web for information and need to install the Python pycrypto Library
(1) To query the installation library, you need to install PIP first
(2) The statement to install PIP:
A, install PIP: It is recommended to install homebrew, 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, the command line continues to execute: Brew install wget
D, this time to check the PIP, has been installed successfully
(3) After installing the PIP, because the default is python2.7, is currently using python3.6 , you need to specify PIP to install to the python3.6
(4) command line to view the PIP version, which is already 9.0.1
Data link: https://www.zhihu.com/question/50470150?sort=created
Data Link: http://brew.sh/index_zh-cn.html
Data Link: http://blog.csdn.net/jiandanjinxin/article/details/53175121
Step two: After the PIP installation is successful, start using the PIP installation Library
(1) Start with the statement: PIP3 install Git+https://github.com/rncryptor/rncryptor-python.git#egg =rncryptor
always prompts the following log:

The

Probably means: The current Python3 version is 8.1.1, need to upgrade to 9.0.1, go to Pycharm to see, it is.
Data Link: http://www.cnblogs.com/wayde-Z/p/6086083.html
(2) began to upgrade the PIP version, around the N-pit, finally found the answer. Only need to execute: Execute
PIP3 install Pymysql
or error, Gao answered, need to execute here:
PIP3 install--upgrade pip
Pip finally prompted the upgrade installation succeeded. Let's start with the PIP installation Library
Step three: Finally! 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
Hint:
This is the prompt has installed this library, do not forget, continue to restart Pycharm, re-run the program, or the hint is missing the library! Go to Python folder, also found this library, in short, is Python3 find this library
(2) directly according to the log of the prompt, has installed the library, with the command line execution:
PIP3 install Crypto, or prompt the above error
Continue execution: PIP3 install Pycrypto or prompt for the above error
Link: http://www.cnblogs.com/xueranzp/p/5010893.html
directly executes the Unload statement: PIP3 Uninstall Pycrypto, prompt uninstall succeeded!!
Execute again: PIP3 install Pycrypto prompt installation success! After restarting Pycharm. Run the project, finally can run!!!

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.