1. Installing virtualenv
Reference: http://docs.jinkan.org/docs/flask/installation.html
2.PyCharm combined with VIRTUALENV development application
Select Create Virtualenv in the settings in the Pycharm-->new Project-->pure python-->interpreter to select the appropriate directory, for example: ~/pycharmprojects/ Pycharm_env/test,pycharm creates a directory with the name of the project under the project name in the test directory, and here I am flask_mysql, then activates the environment:
# Active
SOURCE bin/Activate
Install install flask-install flask-Install Flask-sqlalchemy
# Run Project
Python ~/pycharmprojects/falsk_mysql/manage.py runserver
Reference: Using Virtualenv in Pycharm
Http://www.cnblogs.com/tk091/p/3700013.html
3. Python Python-eggs Exception resolution
Reference: http://blog.csdn.net/livefun/article/details/10222771
4.virtualenv under Import MySQLdb fails, but under normal circumstances, solution: Install Mysql-python under virtualenv
CD flask_mysql/
Ls
git clone https://github.com/jehiah/mysql-python.git
Ls
CD mysql-python/
Ls
Python setup.py Build
Python setup.py Install
There is no error in import MySQLdb under Virtualenv.
Inspired by: https://geert.vanderkelen.org/2014/mysql-connectorpython-on-github/
Https://github.com/jehiah/mysql-python
Ubuntu python pycharm virtualenv