python配置virtualenv环境
2018-12-23 本文已影响0人
BigYellowHsw
两种方式:一种是cmd命令创建虚拟环境再激活,另一种方法是利用pycharm设置里添加个虚拟环境。
第一种:cmd命令创建虚拟环境再激活
例如test文件夹中建立虚拟环境
pip install virtualenv
E:\>cd test
E:\test>virtualenv venv
Using base prefix 'c:\\python\\python35'
New python executable in E:\test\venv\Scripts\python.exe
Installing setuptools, pip, wheel...
done.
开启关闭virtualenv
进入venv目录
激活
cmd>E:\virtualenv\venv>Scripts\activate
关闭
(venv) E:\virtualenv\venv>deactivate
第二种:利用pycharm设置里添加个虚拟环境
在setting设置中查看环境设置

在pycharm下方找到terminal终端即可查看虚拟环境相关信息。默认是使用的虚拟环境,可以在setting设置中更改自己所需环境。
