码迷,mamicode.com
首页 > 移动开发 > 详细

virtualenvwrapper在macos 10.13.6中的使用

时间:2018-09-28 23:28:11      阅读:250      评论:0      收藏:0      [点我收藏+]

标签:done   软件   table   ack   安装   set   Fix   激活   python3.7   

安装虚拟环境参考 https://www.jianshu.com/p/0921fd4d4bca

列出安装的软件

pip list

virtualenv                             15.1.0     

virtualenv-clone                       0.3.0      

virtualenvwrapper                      4.8.2 

创建一个python3的虚拟环境

$mkvirtualenv --python=/usr/local/bin/python3 python_3

Running virtualenv with interpreter /usr/local/bin/python3

Using base prefix ‘/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7‘

/Library/Python/2.7/site-packages/virtualenv.py:1039: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module‘s documentation for alternative uses

  import imp

New python executable in /Users/wangjun/.virtualenvs/python_3/bin/python3.7

Also creating executable in /Users/wangjun/.virtualenvs/python_3/bin/python

Installing setuptools, pip, wheel...done.

virtualenvwrapper.user_scripts creating /Users/wangjun/.virtualenvs/python_3/bin/predeactivate

virtualenvwrapper.user_scripts creating /Users/wangjun/.virtualenvs/python_3/bin/postdeactivate

virtualenvwrapper.user_scripts creating /Users/wangjun/.virtualenvs/python_3/bin/preactivate

virtualenvwrapper.user_scripts creating /Users/wangjun/.virtualenvs/python_3/bin/postactivate

virtualenvwrapper.user_scripts creating /Users/wangjun/.virtualenvs/python_3/bin/get_env_details

(python_3) wangjundeMacBook-Pro:~ wangjun$ python3

Python 3.7.0 (default, Sep 18 2018, 18:47:22) 

[Clang 9.1.0 (clang-902.0.39.2)] on darwin

Type "help", "copyright", "credits" or "license" for more information.

>>> import urllib

>>> import urllib.request

>>> urllib.request.urlopen("http://www.baidu.com")

<http.client.HTTPResponse object at 0x105a49ba8>

>>> exit()

显示所有虚拟环境:workon

(python_3) wangjundeMacBook-Pro:~ wangjun$ workon

py2

python_3

(python_3) wangjundeMacBook-Pro:~ wangjun$ 

退出虚拟环境

$ deactivate

激活虚拟环境

workon python_3

(python_3) wangjundeMacBook-Pro:~ wangjun$

删除虚拟环境

$ rmvirtualenv py2

Removing py2...

(python_3) wangjundeMacBook-Pro:~ wangjun$ workon

python_3

 

 

virtualenvwrapper在macos 10.13.6中的使用

标签:done   软件   table   ack   安装   set   Fix   激活   python3.7   

原文地址:https://www.cnblogs.com/herosoft/p/9721412.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!