Windows 10安装Python 2.7和MySQL-python

1. 安装Python

Download Python

2. 安装MySQL-python

pip install wheel (应该是可选)
pip install mysqlclient==1.3.6

3. 可能出错

    running build_ext
    building '_mysql' extension
    error: Microsoft Visual C++ 9.0 is required. Get it from http://aka.ms/vcpython27

会提示安装vcpython27

Command "c:python27python.exe -u -c "import setuptools, tokenize;__file__='c:\users\user\appdata\local\temp\pip-build-fqbeva\mysqlclient\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('
', '
');f.close();exec(compile(code, __file__, 'exec'))" install --record c:usersuserappdatalocal	emppip-bjcknv-recordinstall-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:usersuserappdatalocal	emppip-build-fqbevamysqlclient

安装mysqlclient不指定版本号可能会出错,需要指定为mysqlclient==1.3.6

原文地址:https://www.cnblogs.com/fatshen/p/8535953.html