virtualenv  方式

安装

    C:\Users\Python> pip install virtualenv
Requirement already satisfied: virtualenv in c:\python36\lib\site-packages (16.4.) C:\Users\Python>

创建

首先创建一个空文件夹

[~]$ mkdir  yangtuo
[~]$ cd yangtuo/
[~/yangtuo]$

创建 虚拟环境

[~/yangtuo]$ virtualenv --no-site-packages yangtuotest
No LICENSE.txt / LICENSE found in source
New python executable in /data/home/v_vtongyang/yangtuo/yangtuotest/bin/python
Installing setuptools, pip, wheel...
done.
[~/yangtuo]$

切换

[~/yangtuo]$ source yangtuotest/bin/activate
(yangtuotest) [~/yangtuo]$

退出

(yangtuotest) [~/yangtuo]$ deactivate
[~/yangtuo]$

virtualenvwrapper  方式

安装

创建虚拟环境需要用到另一个 virtualenvwrapper 如果是 windows 环境下要加 -win

    (testvir) C:\Users\Python\testvir\Scripts>pip install virtualenvwrapper-win
...

创建虚拟环境并进入

    (testvir) C:\Users\Python\testvir\Scripts>mkvirtualenv testvir2
C:\Users\Python\Envs is not a directory, creating
Using base prefix 'c:\\python36'
New python executable in C:\Users\Python\Envs\testvir2\Scripts\python.exe
Installing setuptools, pip, wheel...
done. (testvir2) C:\Users\Python\testvir\Scripts>

查看当前虚拟环境

    C:\Users\Python\testvir\Scripts>workon

    Pass a name to activate one of the following virtualenvs:
==============================================================================
testvir2 C:\Users\Python\testvir\Scripts>

退出虚拟环境

(testvir2) C:\Users\Python\testvir\Scripts>deactivate.bat

进入虚拟环境

    C:\Users\Python\testvir\Scripts>workon testvir2
(testvir2) C:\Users\Python\testvir\Scripts>

pychram  使用虚拟环境

如果已有的直接使用即可

没有的哈则需要自己添加

可以在 pycharm 里面查看下当前环境下的 组件情况以确认是否成功

最新文章

  1. Linux 进程与线程五
  2. [Asp.net 5] DependencyInjection项目代码分析
  3. 使用Markdown+Pandoc+LaTex+Beamer制作幻灯片
  4. 【cs229-Lecture19】微分动态规划
  5. 如何在Quagga BGP路由器中设置IPv6的BGP对等体和过滤
  6. salt-ssh安装及简单使用
  7. 利用Echarts设计一个图表平台(一)
  8. ef6 dbfirst 实现同一套代码多个数据库访问
  9. E297: Write error in swap file解决方法
  10. S_OK与S_FALSE,E_FAIL
  11. STL 源代码剖析 算法 stl_algo.h -- equal_range
  12. 按键精灵*ff
  13. BSGS(Baby Steps,Giant Steps)算法详解
  14. ajax的缺点
  15. Java学习笔记之——Set容器
  16. 部署harbor仓库相关问题总结
  17. oracle 存储过程调用方式
  18. jQuery.ajax()调用asp.net后台方法(非常重要)
  19. git修改提交的用户名
  20. strace使用

热门文章

  1. Python-random模块-59
  2. Python_匿名函数_47
  3. Elasticsearch - 简单介绍
  4. Django model操作
  5. eclipse中不能保存汉字的解决方法
  6. SAP配置BOM的适用范围
  7. ArrayList性能短板深入分析
  8. Oracle 中sql文件的导入导出
  9. python爬虫之scrapy安装(一)
  10. snv的使用