Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

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

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

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-p d:/app/Python36/python.exe py36env

3. Start the virtual environment

Py36env\ Scripts\ activate.bat

4. Exit the virtual environment

Deactivate

Delete the py36env directly if you need to delete the virtual environment.

Method 2: use virtualenvwrapper

1. Installation

Pip install virtualenvwrapper-win

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

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

If it is not set, the relevant folder is automatically created in the current user directory.

3. Create a virtual environment

Mkvirtualenv py36env-p d:/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

The github address of this article:

Virtualenv uses .rst under https://github.com/mike-zhang/mikeBlogEssays/blob/master/2019/20191026_windows

Summary

The above is the editor to introduce to you the way to create a virtual environment using virtualenv under Windows, I hope it will be helpful to you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report