Install Pip and MySQLdb under Python3.4

Source: Internet
Author: User

To use pyhton3.4 to do data analysis, Pip and mysqldb are necessary, a convenient installation of common modules, one for the operation of the database. When the two modules were installed, it took a lot of time to install them because there was no one to guide them.

When installing PIP, follow the online tutorial, first download the pip8.1 in the link https://pypi.python.org/pypi/pip, follow the usual method, after extracting the Python setup.py install. Found an error "Importerror:no module named ' Pip '", also do not know what the situation, looking for information everywhere, or not yo solved. Finally have to try to install the general pip Delete Uninstall, and then from this link https://pip.pypa.io/en/latest/installing/#do-i-need-to-install-pip download get-pip.py. The reinstallation was successful.

The installation of the MYSQLDB is more tortuous. or in accordance with the normal method of installation, download mysql-python-1.2.5 version, after extracting Python setup.py install, found how to install will error "ConfigParser.NoSectionError:No section : ' Metadata ', and then using PIP installation, also prompted "Error:microsoft Visual C + + 10.0 is required (unable to find vcvarsall.bat)." In accordance with the scheme provided by users, to install GCC compilation, and then to download MinGW installation, installed after the MinGW configuration environment parameters, or the same error. There's no way, drink some water. Suddenly an epiphany, is not python3.4 not support MYSQLDB? Google a bit, sure enough. Python3 no longer supports MYSQLDB. Its replacement module is Pymysql (: Https://github.com/PyMySQL/PyMySQL), hurriedly download the installation, modify the program, finally happy to run up. Note: Pymysql cannot be installed with PIP.

The two twists and turns in the process here, one is to save notes, but also to give other friends a reference, as little as possible to trample the pit.

Install Pip and MySQLdb under Python3.4

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.