Python与Excel--02环境virtualenv

Posted CevinChen

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Python与Excel--02环境virtualenv相关的知识,希望对你有一定的参考价值。

1.virtualenv是用来创建 Python 的虚拟环境的库

#安装
pip install virtualenv

#创建一个虚拟环境
virtualenv new_env

#
F:envs>virtualenv new_env
Using base prefix f:\python352
New python executable in F:envs
ew_envScriptspython.exe
Installing setuptools, pip, wheel...done.

#在 Windows 系统上面使用 virtualenv,进入目录
F:envs>cd new_envScripts

#激活虚拟环境
F:envs
ew_envScripts>activate
(new_env) F:envs
ew_envScripts>python
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

#pip list 查看库版本
(new_env) F:envs
ew_envScripts>pip list
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.co
nf under the [list] section) to disable this warning.
pip (9.0.1)
setuptools (38.5.2)
wheel (0.30.0)

 

2.virtualenvwrapper 是一个 virtualenv 虚拟环境的管理库
pip install virtualenvwrapper-win

virtualenvwrapper 命令

  • 创建虚拟环境:mkvirtualenv new_env
  • 使用虚拟环境:workon new_env
  • 退出虚拟环境:deactivate
  • 删除虚拟环境: rmvirtualenv new_env
  • 查看所有虚拟环境:lsvirtualenv
 



以上是关于Python与Excel--02环境virtualenv的主要内容,如果未能解决你的问题,请参考以下文章

Python virtual env

Python virtual env

Ubuntu安装虚拟环境

[Django] 创建python virtual environment 虚拟环境 并激活 | 安装配置Django

[Django] 创建python virtual environment 虚拟环境 并激活 | 安装配置Django

新手学Python之学习官网教程(十二: Virtual Environments and Packages)