Python2.7版本 环境搭建(Windows)

Python 下载 安装

下载页面 : https://www.python.org/downloads/release/python-2714/

下载 : Windows x86-64 MSI installer 2.7.14

环境变量

如果你在安装的时候勾选了 "install python.exe to path",类似于这样的选项,一般不用设置环境变量,不过可以再检查一下。

这里假如安装在 K:\Python\Python27 目录下,需要设置 K:\Python\Python27 和 K:\Python\Python27\Scripts 到环境变量 PATH 中。

执行 python -h 查看是否安装成功

pip 安装

pip is already installed if you're using Python 2 >=2.7.9 or Python 3 >=3.4 binaries downloaded from python.org, but you'll need to upgrade pip.

如果你安装的 Python 版本大于 >=2.7.9 或者 >=3.4 ,pip 自带的,
如果不是,请参考以下安装(更新)文档 pip Installation

执行 pip help 查看是否安装成功(建议在 PowerShell 下或者 git bash 下执行)

MySQLdb 安装

pip install mysql-python

异常处理

error: Microsoft Visual C++ 9.0 is required

根据提示 访问 http://aka.ms/vcpython27 下载包安装

fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory

  1. 安装 wheel : pip install wheel
  2. 下载 64位的 MySQL-Python: https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysql-python
  3. 安装 .whl 文件 : pip install MySQL_python-1.2.5-cp27-none-win_amd64.whl

 

IDE

这里建议使用 Jetbrains 开发 PyCharm,下载地址 http://www.jetbrains.com/pycharm/download/

下载免费的 社区版(Community)就足够用了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值