1.下载python 2.7.X 或者 python 3.X
官网下载地址:https://www.python.org/downloads/windows/ 最好下载和系统(x86 or amd64)相对应的版本
安装 很简单 ,不说了。安装时最好选择加入Path中,没选择也有关系,百度 搜索一下,手动把python 加入 环境变量中 ,在cmd 输入python 应该就能看到
2.安装pip 。如果自动带有pip 就不用安装了(在cmd 输入pip,不报找不到命令这类的错就自带pip)。没有自动安装pip,那就 去下载pip安装或者 easy_install 安装 pip
在cmd下 切换到 下载pip 文件中 安装命令 python setup.py install
3.pip install xxx 报错
1. pip install 出现报asciii码错误的问题 参考 : http://blog.youkuaiyun.com/jcxch/article/details/50487604
2.pip install mysql 报错 (以python 2.7.x为例)
(1) 报 Microsoft\Visual C ++ for Python\9.0\VC Compiler \ 之类的错误时
原因 :少安装了 微软 compiler
解决办法:
下载地址:https://www.microsoft.com/en-us/download/details.aspx?id=44266
找到: Microsoft Visual C++ Compiler for Python 2.7 下载
(2) 报错
_mysql.c
_mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h': No s uch file or directory
error: command '"C:\Users\fnngj\AppData\Local\Programs\Common\Microsoft\Visual C ++ for Python\9.0\VC\Bin\amd64\cl.exe"' failed with exit status 2
----------------------------------------
Cleaning up... Command C:\Python27\python.exe -c "import setuptools, tokenize;__file__='c:\\use rs\\fnngj\\appdata\\local\\temp\\pip_build_fnngj\\MySQL-python \\setup.py';exec(c ompile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), _ _file__, 'exec'))" install --record c:\users\fnngj\appdata\local\temp\pip-peervp -record\install-record.txt --single-version-externally-managed --compile failed with error code 1 in c:\users\fnngj\appdata\local\temp\pip_build_fnngj\MySQL-pyt hon Storing debug log for failure in C:\Users\fnngj\pip\pip.log
原因:原因是安装MySQL的时候没有安装C语言库。
解决办法 :1. pip install MySQL-python (没试过)。2我百度 的 MySQL-python-1.2.3.win-amd64-py2.7.exe 然后安装的
写的草率,多有不清楚地方,慢慢完善