Python3虚拟环境--venv
Python3.3以上的版本通过venv模块原生支持虚拟环境,可以代替之前的virtualenv。
该venv模块提供了创建轻量级“虚拟环境”,提供与系统Python的隔离支持。每一个虚拟环境都有其自己的Python二进制(允许有不同的Python版本创作环境),并且可以拥有自己独立的一套Python包。
注意:python3.3中使用”venv”命令创建的环境不包含”pip”,需进行手动安装。Python3.4中改进了这一缺陷。
创建虚拟环境
python -m venv myvenv
此命令会在当前目录下生成一个名为myvenv的目录,myenv也是创建的虚拟环境名。
激活环境:
/Scripts/activate.bat
退出环境:
/Scripts/deactivate.bat
附:
venv使用参数:
usage: venv [-h] [--system-site-packages] [--symlinks] [--clear]
[--upgrade] [--without-pip] ENV_DIR [ENV_DIR ...] Creates virtual Python environments in one or more target directories. positional arguments:
ENV_DIR A directory to create the environment in. optional arguments:
-h, --help show this help message and exit
--system-site-packages Give access to the global site-packages dir to the
virtual environment.
--symlinks Try to use symlinks rather than copies, when symlinks
are not the default for the platform.
--copies Try to use copies rather than symlinks, even when
symlinks are the default for the platform.
--clear Delete the environment directory if it already exists.
If not specified and the directory exists, an error is
raised.
--upgrade Upgrade the environment directory to use this version
of Python, assuming Python has been upgraded in-place.
--without-pip Skips installing or upgrading pip in the virtual
environment (pip is bootstrapped by default)
Python3虚拟环境--venv的更多相关文章
- python3 虚拟环境 venv
创建一个虚拟环境: python -m venv test (test 为创建的虚拟环境目录) 激活虚拟环境: test\Scripts\activate ...
- 关于Python3中venv虚拟环境
Python3.3以上的版本通过venv模块原生支持虚拟环境,可以代替Python之前的virtualenv. 该venv模块提供了创建轻量级"虚拟环境",提供与系统Python的 ...
- day 56 linux的安装python3 ,虚拟环境,mysql ,redis
1.1下载python源码包 网址:https://www.python.org/downloads/release/python-366/ 下载地址:https://www.python.org/f ...
- python3 虚拟环境配置
CentOS7 python3 虚拟环境配置 1. 安装依赖包 yum -y install wget gcc epel-release git 2. 安装 Python3.6 yum -y inst ...
- python3虚拟环境应用
python3自带虚拟环境venv,大致操作只有三步 1. 创建虚拟环境 python3 -m venv venv(名称随意) 2. 激活虚拟环境 source venv/bin/activate 3 ...
- Python - 虚拟环境 venv
什么是虚拟环境 这是 Python 3.3 的新特性:https://www.python.org/dev/peps/pep-0405/ 假设自己电脑主机的 Python 环境称为系统环境,而默认情况 ...
- python使用虚拟环境venv
venv模块支持使用自己的站点目录创建轻量级"虚拟环境",可选择与系统站点目录隔离.每个虚拟环境都有自己的Python二进制文件(与用于创建此环境的二进制文件的版本相匹配),并且可 ...
- Ubuntu安装python3虚拟环境
大多数Linux自带python2.7,而Ubuntu1.6也自带python3.x,本文章主要记录virtualenv+vitualenvwrapper使用python3虚拟环境 虚拟环境好处不多说 ...
- ubantu安装python3虚拟环境
Ubuntu安装python3虚拟环境 安装虚拟环境 步骤: 打开Linux终端(快捷键Ctrl+Alt+T),输入命令: sudo apt install python-virtualenv sud ...
随机推荐
- 初识 go 语言:语法
目录 语法 for 循环 if 语句 switch 语句 defer 语句 defer 栈 结束 前言: go语言系列第二篇,主要讲述go语言的语法,如循环,if判断,swich语句,defer语句, ...
- django-url的分发
1)url的分发: 1,首先在全局的url里面的路径中写好,你要分发的路径名. 2,并且在你要分发的路径下,创好新的url文件. 在分发的路径名里面,把全局url里面的代码,复制过来 3,最后在浏览器 ...
- ES6部分知识点总结
注:本文通过yck前端面试小册学习整理而得,记录下来供自己查阅 1.var 变量提升 使用var声明的变量,声明会被提升到作用域的顶部 举几个例子: eg1: console.log(a) // un ...
- 启动多个logstash脚本
一台服务器上启动多个logstash脚本 # more logstash_click #!/bin/sh # Init script for logstash # Maintained by Elas ...
- ArcGis Python脚本——根据接图表批量裁切分幅影像
年前写了一个用渔网工具制作图幅接图表的文章,链接在这里: 使用ArcMap做一个1:5000标准分幅图并编号 本文提供一个使用ArcMap利用接图表图斑裁切一幅影像为多幅的方法. 第一步,将接图表拆分 ...
- oldboy s21day09
#!/usr/bin/env python# -*- coding:utf-8 -*- # 1.将函数部分知识点,整理到自己笔记中.(搞明白课上讲的案例.) # 2.写函数,检查获取传入列表或元组对象 ...
- densenet 中的shortcut connection
DenseNet 在FCN 网络中考虑加入skip connection,在resnet 中加入identity 映射,这些 shortcut connection等结构能够得到更好的检测效果,在d ...
- 2.5 elif
elif 想一想: if能完成当xxx时做事情 if-else能完成当xxx时做事情1,否则做事情2 如果有这样一种情况:当xxx1满足时做事情1:当xxx1不满足.xxx2满足时做事情2:当xxx2 ...
- sql server 2008 中的 server profiler 的简单使用
server profiler 是一个SQL server的 数据库执行语句的监控工具. 登录你需要监控的数据库. 2 .设置要监控进程的PID. 3.设置监控的数据库. 4 . 最后点击运行 就可以 ...
- 5.CentOS7安装mariadb
MariaDB 和 MySQL 使用是一样的,二者只要安装一个就行了 MariaDB数据库管理系统是MySQL的一个分支,主要由开源社区在维护,采用GPL授权许可.开发这个分支的原因之一是:甲骨文公司 ...