由于python 3 已是目前稳定,且是将来版本版本。新学者可以直接从python3入手学习。但是目前还有很多企业级应用使用的是python 2,可能还得要维护。所以,我们在本地windows中可以安装python多版本,进行熟悉。
官网地址:https://www.python.org
安装时,勾选“Add Python 3.x to PATH” 或者安装后配置环境变量
将安装目录下的 C:\Python35\python.exe 改名为 python3.exe
将python 3 中的 C:\Python35\Scripts\pip.exe 删掉
如果出现上方错误提示,则重新更新python3 的pip 即可,命令如下
C:\WINDOWS\System32>python3 -m pip install -U pip Collecting pip Downloading pip-8.1.2-py2.py3-none-any.whl (1.2MB) 35% |███████████▏ | 419kB 117kB/s eta 0:00:07 Successfully installed pip-8.1.2python -m pip install --upgrade pip
C:\Users\Administrator>pip3 --version pip 1.5.6 from D:\360YP\VM\python2.7\lib\site-packages (python 2.7) C:\Users\Administrator>python -m pip --version pip 1.5.6 from D:\360YP\VM\python2.7\lib\site-packages (python 2.7) C:\Users\Administrator>python -m pip install --upgrade pip Downloading/unpacking pip from https://pypi.python.org/packages/b6/ac/7015eb97dc749283ffdec1c3a88ddb8ae03b8fad0f0e611408 f196358da3/pip-9.0.1-py2.py3-none-any.whl#md5=297dbd16ef53bcef0447d245815f5144 Installing collected packages: pip Found existing installation: pip 1.5.6 Uninstalling pip: Successfully uninstalled pip Successfully installed pip Cleaning up... C:\Users\Administrator>pip --version pip 9.0.1 from D:\360YP\VM\python2.7\lib\site-packages (python 2.7) C:\Users\Administrator>pip3 --version pip 9.0.1 from d:\360yp\vm\python35\lib\site-packages (python 3.5)
转载于:https://www.cnblogs.com/guanfuchang/p/5839018.html