uncategorized

python virtualenv

Virtualenv

Installation

1
> pip install virtualenv

User Guide

1. use the same version

1
2
# 虚拟Python环境 ENV is path
> virtual ENV

2. different python version

1
2
3
# PYTHON: 指定使用Python版本(C:\Python27\python.exe)
# ENV: 新建环境的目录位置
> virtualenv -p PYTHON ENV

启动

1
2
3
4
5
6
7
8
9
10
11
# activate
# powershell
> Set-ExecutionPolicy AllSigned
> Set-ExecutionPolicy RemoteSigned
> /path/to/ENV/Scripts/activate.ps1

# shell
> source /path/to/ENV/bin/activate、

# deactivate
> deactivate
Share