ubuntu18.04 Python virtual Environment installation using

Source: Internet
Author: User
Tags install django virtual environment virtualenv
Installation
sudo apt install virtualenv

Originally used PIP3 installed virtualenv, but the use of the time will still be prompted to find.

Create a virtual environment
sudo virtualenv -p /usr/bin/python3.6  venv_name  #venv_name即为虚拟环境名称

  • Here, with-p to develop a python environment, Ubuntu comes with a python2 environment, which defaults to using Python2
  • You can see that the virtual environment is installed by default in/usr/python_venv by the hints in the diagram
Environment activation use

Switch to the Virtual environment directory
Example:/usr/python_venv/fordjango1.1/bin
Execute the acitivate_this.py script to

Install third-party libraries for virtual environments

Execute PIP3 in the bin directory of the virtual environment

For example

$ sudo ./pip3 install django==1.10

ubuntu18.04 Python virtual Environment installation using

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.