仅需5步,搭建python2.7 和python 3.0 的多运行环境
第一步:装好 python2.7
第二步:装好pycharm
上面的2步,已经可以让项目运行在2.7上面了,接下里的步骤,我们要实现 3.0 的共存
第三步:安装virtualenv
第四步: 选择一个目录,在env环境,创建3.0的运行环境
virtualenv -p python3 python3env
上面这句话的意思就是,创建python3env的目录,并且安装python3的环境
验证python3的环境是否成功
source python3env/bin/activate
激活虚拟环境,激活后,可以pip install,退出虚拟环境,deactivate 就可以了
python
最后出现了python3.6的提示
Python 3.6.1 (default, Apr 4 2017, 09:36:47)
[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin
Type “help”, “copyright”, “credits” or “license” for more information.