windows环境下python虚拟环境的搭建
来源:互联网 发布:android 系统日历源码 编辑:程序博客网 时间:2024/06/01 08:38
虚拟环境的作用:在python项目开发的过程中每个项目所需要的依赖模块会有所不同,所以要想在一台电脑上同时进行多个python项目时,则需要为每个项目创建其对应的虚拟Python环境,在自己的虚拟环境中安装自己项目所需要的模块即可,从而项目之间在环境上不存在依赖。
(Python的虚拟环境可以使一个Python程序拥有独立的库library和解释器interpreter,而不用与其他Python程序共享统一个library和interpreter。虚拟环境的好处是避免了不同Python程序间的互相影响(共同使用global library 和 interpreter),例如程序A需要某个库的1.0版本,而程序B需要同样这个库的2.0版本,如果程序B执行则A就不能执行了。)
1、下载python2.7和python3.5
2、安装python2.7和python3.5(不要环境变量:配置会存在切换问题)
3、cmd进入python2.7和python3.5的Scripts目录。
4、使用pip install virtualenv安装对应的创建虚拟环境(一般和项目对应:因为每个项目所需要的模块不同所以应该有自己的虚拟环境包含当前项目所需要的模块)包。
5、分别在python2.7和python3.5的Scripts目录使用(virtualenv 虚拟环境目录) 创建对应的虚拟环境。
虚拟环境目录(自定义):会创建一个与虚拟环境名称相同的文件夹venv, 里面存储了一个独立的Python执行环境。
6、分别进入python2.7和python3.5虚拟环境的Scripts目录下使用用命令: activate激活虚拟环境。(Python35env) D:\Python35env\Scripts>
7、使用命令:pip install numpy 为当前虚拟环境安装数学计算模块(类似的想在当前虚拟环境下安装其他模块用:pip install 模块名)。
8、退出虚拟环境:deactivate
9、删除虚拟环境:直接删除虚拟环境所在的文件夹venv就删除了我们创建的venv虚拟环境(也可用windows命令)。
- windows环境下python虚拟环境的搭建
- windows下python中virtualenv虚拟环境搭建
- Python 虚拟环境的搭建
- python虚拟环境的搭建
- Python虚拟环境的搭建
- windows系统下多个Python虚拟环境搭建
- Windows下Python环境的搭建
- windows系统下Python环境的搭建
- windows系统下Python环境的搭建
- Windows下的Python环境搭建
- windows系统下Python环境的搭建
- windows系统下Python环境的搭建
- windows系统下Python环境的搭建
- windows下Python环境的搭建
- windows系统下Python环境的搭建
- windows系统下Python环境的搭建
- windows系统下Python环境的搭建
- windows系统下Python环境的搭建
- spring boot之集成kafka
- 2017年8月前端开发者超实用干货大合集
- iOS block与封装
- @Autowired与@Resource的区别
- 系统加固
- windows环境下python虚拟环境的搭建
- 柱状图
- github的常用操作,ssh的配置,github免费域名
- Picasso和Glide对比(不深入)
- Failed to execute /init. Attempting defaults...
- HTML页面与基本标记
- hdu1005 Number Sequence
- Java JSON时间格式化
- Spring 中 Bean的作用域