How to create a virtual environment using virtualenv under Windows (two ways)

How to create a virtual environment using virtualenv under Windows (two ways)

Operating system: windowns10_x64

Python version: 3.6.8
virtualenv version: 16.7.7
virtualenvwrapper version: 1.2.5

Method 1: Use virtualenv directly

1. Installation

pip install virtualenv

2. Create a virtual environment

virtualenv -pd:/app/Python36/python.exe py36env

3. Start the virtual environment

py36env\Scripts\activate.bat

4. Exit the virtual environment

deactivate

If you need to delete the virtual environment, just delete py36env.

Method 2: Using virtualenvwrapper

1. Installation

pip install virtualenvwrapper-win

2. Set the environment variable WORKON_HOME to specify the default path of the virtualenvwrapper virtual environment

For example, set it to c:\venv and create the venv directory.

If not set, the relevant folders will be automatically created in the current user directory.

3. Create a virtual environment

mkvirtualenv py36env -pd:/app/Python36/python.exe

4. View all virtual environments and start virtual environments

lsvirtualenv

workon py36env

5. Exit the virtual environment

deactivate

If you need to delete the virtual environment, execute the following command:

rmvirtualenv py36env

This article's github address:

https://github.com/mike-zhang/mikeBlogEssays/blob/master/2019/20191026_Use virtualenv under windows.rst

Summarize

The above is the way I introduced to you to use virtualenv to create a virtual environment under Windows. I hope it will be helpful to you!

You may also be interested in:
  • Detailed installation and use of Python virtual environment virtualenv under Windows
  • Install Python virtual environment virtualenvwrapper-win under Windows
  • Python virtual environment virtualenv usage tutorial
  • Installation and use of Python virtual environment virtualenv
  • Detailed installation and use of Python virtual environment virtualenv
  • How to install Python virtual environment virtualenv on Linux
  • Python Virtual Environment Virtualenv Usage Tutorial

<<:  How to store text and pictures in MySQL

>>:  How to preview pdf file using pdfjs in vue

Recommend

Detailed explanation of writing multiple conditions of CSS: not

The :not pseudo-class selector can filter element...

Token verification login in Vue project (front-end part)

This article example shares the specific code of ...

MySQL foreign key (FOREIGN KEY) usage case detailed explanation

Introduction: The disadvantages of storing all da...

Summary of MySQL InnoDB architecture

Table of contents introduction 1. Overall archite...

Example of how to generate random numbers and concatenate strings in MySQL

This article uses an example to describe how MySQ...

Example of how to create a database name with special characters in MySQL

Preface This article explains how to create a dat...

Use of Linux ipcs command

1. Command Introduction The ipcs command is used ...

Example of using nested html pages (frameset usage)

Copy code The code is as follows: <!DOCTYPE ht...

Design Theory: Hierarchy in Design

<br />Original text: http://andymao.com/andy...

Install nvidia graphics driver under Ubuntu (simple installation method)

Install the nvidia graphics card driver under Ubu...

Examples of clearfix and clear

This article mainly explains how to use clearfix a...

CentOS7 installation GUI interface and remote connection implementation

Use the browser (webdriver)-based selenium techno...

Summary of how to use bootstrap Table

This article shares with you how to use bootstrap...