安装
windows下安装
pip3 install virtualenv
linux下安装
使用
[root@host188 ~]# mkdir myproject
[root@host188 ~]# cd myproject/
[root@host188 myproject]# virtualenv --no-site-packages venv
New python executable in /root/myproject/venv/bin/python
Installing setuptools, pip, wheel...done.
[root@host188 myproject]# source venv/bin/activate
(venv) [root@host188 myproject]# python --version
Python 2.6.6
(venv) [root@host188 myproject]# python3 --version
Python 3.5.2
(venv) [root@host188 myproject]# pip3 install jinjia2
Collecting jinjia2
Could not find a version that satisfies the requirement jinjia2 (from versions: )
No matching distribution found for jinjia2
(venv) [root@host188 myproject]# pip3 install jinja2
Collecting jinja2
Downloading Jinja2-2.8-py2.py3-none-any.whl (263kB)
100% |████████████████████████████████| 266kB 802kB/s
Collecting MarkupSafe (from jinja2)
Downloading MarkupSafe-0.23.tar.gz
Installing collected packages: MarkupSafe, jinja2
Running setup.py install for MarkupSafe ... done
Successfully installed MarkupSafe-0.23 jinja2-2.8
(venv) [root@host188 myproject]# pwd
/root/myproject
(venv) [root@host188 myproject]# deactivate
[root@host188 myproject]#