Set up a Python3 virtual environment under Ubuntu (for Django with PostgreSQL database development)

Source: Internet
Author: User
Tags postgresql install django pip install django virtual environment

#安装python Pip (installed in the physical environment)
sudo apt-get install Python-pip
sudo apt-get install Python3-pip
sudo pip install--upgrade pip
sudo pip3 install--upgrade pip Note Description: Python-pip is the Python2 version of the package management tool, PYTHON3-PIP is the Python3 version of the package management tool, if you create a python2 of virtual Environment, when the above four commands are executed, using PIP in a virtual environment is the Python2 package management tool if you create a PYTHON3 virtual environment, use PIP in a virtual environment when you have completed the above four commands Python3 guarantee the science and technology And in different virtual environments, you must also use the corresponding Package management tool (I've been in this hole for a long time)
#安装redis
wget http://download.redis.io/releases/redis-3.2.0.tar.gz//This URL downloads the Redis installation package
Tar xzf redis-3.2.0.tar.gz//download and put it in any directory to unzip
CD redis-3.2.0//Enter the redis-3.2.0 directory
Make//Execute make
sudo make install//Super User privileges Execute make install
CD utils//Enter Utils
Echo-e "\ n" | sudo./install_server.sh//execute this line command (installed everywhere)
CD ~//home Directory
#安装postgresql
sudo apt-get install PostgreSQL
sudo apt-get install Libpq-dev
sudo apt-get install Libjpeg8-dev (this does not install will cause the pillow==3.2.0 to fail in the virtual environment)
#创建环境 (Create a PYTHON3 virtual environment)
Mkvirtualenv-p/usr/bin/python3 Fresh #自行改名 is installed in a virtual environment: (This is the configuration of the required development projects in the virtual environment can be replaced as needed)
Pip Install django==1.7.4
Pip Install psycopg2==2.6.1//This is used to configure DjangoPostgreSQL Database is a PostgreSQL driver no it Django can't use PostgreSQL databasePip Install jsonfield==1.0.3
Pip Install pillow==3.2.0
Pip Install django-redis-sessions==0.5.0
Pip Install django-haystack==2.4.1
Pip Install celery==3.1.23
Pip Install Uwsgi

Set up a Python3 virtual environment under Ubuntu (for Django with PostgreSQL database development)

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.