python 在WINDOS虚拟环境部署

时间:2021-12-07 16:32:08
#查看电脑的版本
C:\Users\lys>pip -V
pip 8.1.1 from e:\python\python3.5\lib\site-packages (python 3.5)
#安装
C:\Users\lys>pip install virtualenv
#创建
C:\Users\lys>virtualenv testvir
#进入
C:\Users\lys>cd testvir
C:\Users\lys\testvir>cd Scripts
C:\Users\lys\testvir\Scripts>activate.bat
(testvir) C:\Users\lys\testvir\Scripts> #安装
C:\Users\lys\testvir\Scripts>pip install virtualenvwrapper-win
#创建
C:\Users\lys\testvir\Scripts>mkvirtualenv testvir2
#退出
(testvir2) C:\Users\lys\testvir\Scripts>deactivate
C:\Users\lys\testvir\Scripts> #查看
C:\Users\lys\testvir\Scripts>workon
Pass a name to activate one of the following virtualenvs:
==============================================================================
testvir2
#进入指定虚拟环境
C:\Users\lys\testvir\Scripts>workon testvir2
(testvir2) C:\Users\lys\testvir\Scripts>
(testvir2) C:\Users\lys\testvir\Scripts>deactivate.bat
C:\Users\lys\testvir\Scripts> #进入指定虚拟环境,安装django
C:\Users\lys>workon muke
(muke) C:\Users\lys>pip install django==1.9.8
Collecting django==1.9.8
Downloading Django-1.9.8-py2.py3-none-any.whl (6.6MB)
100% |████████████████████████████████| 6.6MB 76kB/s
Installing collected packages: django
Successfully installed django-1.9.8
################################################################
下载mysql-python 的安装包
http://www.lfd.uci.edu/~gohlke/pythonlibs/#mysql-python
D:\Desktop>workon muke
(muke) D:\Desktop>pip install MySQL_python-1.2.5-cp27-none-win_amd64.whl
(muke) D:\Desktop>pip list
MySQL-python (1.2.5)
(muke) D:\Desktop>