Install Pymysql in Python3 under Windows system

Source: Internet
Author: User

Python2 and Python3 are incompatible, and in Py2, the linked database uses MYSQLDB, but it is not available in Py3.

The solution is that the module used in the PY3 database is Pymysql.

Installing a third-party library in a DOS window uses a PIP installation.

    1. First go to the Python installation directory and locate and enter the Scripts folder. For example mine is:

      < I don't know. Python default installation Just give me the whole place! >

    2. To use the PIP installation command:
      Python3 pip.exe Install Pymysql # I use Python3 because the py2 and py3 coexist in the computer. This distinguishes it!


      This completes the installation of MySQL in Python3.
    3. To test the import package:
      Import Pymysql


      Import successfully, then you can use it! # I don't know why it's all lowercase when it's imported

Originality is not easy, respect copyright. Reprint Please specify source:http://www.cnblogs.com/xsmile

Install Pymysql in Python3 under Windows system

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.