【爬虫学习1】windows下Anaconda环境搭建(不和原有
2018-09-02 本文已影响411人
yuanCruise
1.下载python3,通过anaconda的方式获取(比较方便)
anaconda下载地址
在下面的界面选择Python3.6版本的Download按钮。

下载完成后,直接双击安装包安装即可,安装完成后,python3的环境就配置好了。
2.添加别名
由于系统中很可能存在两个版本的python,因此会导致当你在命令行输入python的时候并不能够按照你自己的意愿调用对应的python,所以在你的python安装后的路径中找到python.exe文件,将其复制一份,并且重命名为python35.exe。这样就不会和类似于python2等其他python版本发生冲突。对于当前安装的python版本你既可以用python调用,也可以用python35调用。测试结果如下:

3.当系统中存在多个python环境的情况下如何使用对应的pip指令
很简单,基于上面所示的修改了python.exe的别名之后,就可以用别名来调用对应的pip。调用方式如下图所示(调用结果见最后):
pythonX -m pip -V
4.windows10下配置环境变量
上述提到的用不同的python名的exe调用和不同-m限制的pip的使用,都必须在安装了对应版本的python的文件夹中进行操作。为了能够在电脑的任何位置打卡cmd都能够利用上述的操作进行,需要对环境变量进行配置,将各个版本的python安装路径添加到path中。具体过程如下:
1.进入系统

2.进入高级系统设置

3.点击环境变量

4.点击path

5.将所有的python,包括anaconda的安装路径都添加到path中

最终就可以在桌面打开cmd,执行如下图所示操作,至此你安装anaconda基本就完成了(而且不会和电脑中已经有的python版本发生冲突)。:

本人csdn博客地址:https://blog.csdn.net/qiu931110/
本人微信公众号:yuanCruise
