欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

virtualenv easy guide

程序员文章站 2022-06-06 16:06:25
...

1. Installation

You must have already installed python two versions, say python27 and python36.
Then you should have installed pip.
Run either pip or pip3 isntall virtualenv
You can type virtualenv -h for help info.
virtualenv easy guide

Common params

-p used to designate the python version for this virtual environment you want to create.

2. Activate

Use the following commands in windows cmd line

virtualenv -p c:\python36\python.exe py36env
cd py36env
Scripts\activate
python

Then you will see the welcome message:

Python 3.6.0 (default, Jan 23 2017, 20:01:14) [MSC v.1900 64 bit (AMD64)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.
>>>

If you want to deactivate, just type:
Scripts\deactivate
in the same directory you executed activate

Enjoy

相关标签: python virtualenv