Pycharm Virtual Environment VIRTUALNV installing MySQL Extensions

Source: Internet
Author: User

First, start Pycharm, create a Django project in a virtual environment

1. Menu-file-new Project ...

2. Select "Django" in the "Select Project Type" window

3, click "Interpreter" the rightmost setting icon, select "Create virtualenv"

Parameters:

Location:e:\pycharmprojects\tm

Interpreter:e:\virtualenv\tm

Application Name:tmjob

Enable Django admin: Tick

4. Set "name" (Virtual Environment Name) "Location" (Virtual Environment Storage) "Base interpreter" (based on which Python interpreter) in the "Create Virtual Environment" window Inherit Global Site-packages "(Inherited Site-packages Package)

Parameters:

Name:tm

Location:e:\virtualenv\tm

Base interpreter:windows installed python2.7.10 (32bit)

Inherit Global site-packages: Uncheck

Description

If base interpreter is based on the 2.x version, the virtual Environment version is also 2.x. If based on the 3.x version, the virtual Environment version is also 3.x.

"Inherit Global Site-packages" Inherits "Site-packages" from "Base interpreter"

5, "Create Virtual environment" set up and click "OK", in the Virtual environment directory "E:\VIRTUALENV\TM" under the virtual environment file generation

6. After the "Select Project Type" is set up, click "Create" to build the project file under the project directory "E:\PycharmProjects\TM".

7. Pycharm Project

Second, add MySQL extension

Menu-file-settings

1. Under "Project:tm"-"Project Interpreter", click the "+" in the expansion pack list or double-click the blank part of the list with the left mouse button.

Search for "MySQLdb", no matching. Search for "Mysql-python" again and click "Install package" for installation

However, hehe ...

All right, I'm little white. Command installation, Pip install MySQLdb

2, start the cmd, start the virtual environment, the command is as follows:

Okay, pip install MYSQLDB command won't work.

Bonus a PIP Upgrade command: python-m pip install--upgrade pip

Try Easy_install after Pip doesn't work.

Easy_instal MySQLdb is not feasible, easy_instal Mysql-python can be used. Or go to the official website to download, and then install the source code in the virtual environment

Again go to Pycharm project settings under View, found that the installation is successful!!!

Pycharm Virtual Environment VIRTUALNV installing MySQL Extensions

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.