创建一个专门存放站点的目录(虚拟环境)
mkdir Desktop/Project/virtualenv
创建python3.5的虚拟环境
注意:需要指定python3.5的目录
$ cd Desktop/Project/virtualenv
$ virtualenv -p /Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5 test
进入虚拟环境
source Desktop/Project/virtualenv/test/bin/activity
进入虚拟环境后查看python版本
注意:直接执行python就OK,pip也是直接执行pip,自动对应的就是python3.5和pip3.5
Python 3.5.4 (v3.5.4:3f56838976, Aug 7 2017, 12:56:33)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.