Python 环境配置
既然从头开始那就从环境开始吧
- Windows下载安装
既然下载必须找Python的官网啦,https://www.python.org/ ORG域名 非营利组织都懂得
因为版本兼容性问题,你是需要2.7X版本还是3.X版本 根据自己的需求选择下载
https://www.python.org/ftp/python/此链接为官方FTP下载地址 内有所以Python发布版本。
- 安装Python
根据系统选择你要安装的版本


Install Python 3.6.1 (64-bit)
Select Install Now to install Python with default settings,or choose Customize to enable or disable features.
Install Now
Includes IDLE,pip and documentation #安装IDLE和pip工具
Creates shortcuts and file associations #创建快捷方式和关联
Customize installation #自定义安装
choose location and features #选择位置和功能
add python 3.6 to PATH #勾选
选择add python3.6 to PATH 选择第一项把pip装上
等待 不出意外windows Python环境已经安装成功,提示有在线文档
https://docs.python.org/3.6/tutorial/index.html
先来看一下环境变量有没有生效

再看看pip

这明显是我想要的结果!!
- Linux 下升级到Python3
- CentOS
因为博客园没自动保存草稿,之前编辑好的文档没有保存下来 下面是简单的把安装时执行的命令从history中导出来的。
-
yum install wget gcc-c++ openssl-devel zlib-devel #安装依赖 wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tgz #下载python3.6 tar -zxvf Python-3.6.1.tgz #解压缩 cd Python-3.6.1 ./configure --prefix=/usr/local/python3 --enable-shared #开始编译安装到 /usr/local/python3 目录下 make & make install ln -s /usr/local/python3/bin/python3.6 /usr/bin/python3 ln -s /usr/local/python3/bin/pip3.6 /usr/bin/pip3
ln -s /usr/local/python3/bin/easy_install-3.6 /usr/bin/easy_install3 cp -R /usr/local/python3/lib/* /usr/lib64/ #安装完成会缺少模块,模块放在安装目录下 lib目录中 which pip3 python3 -V pip3 -V![]()
本来去安装readlin的装了几次无法安装,安装一个gnureadline吧,否则在python3里没办法退格,发现readlin的官方文档
https://github.com/ludwigschwardt/python-gnureadline
执行 pip3 install gnureadline
- 编辑器

浙公网安备 33010602011771号