Ubuntu python pycharm virtualenv

Source: Internet
Author: User
Tags virtualenv

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

Related Article

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.