这个操作方法很容易百度到。加完了重启,然后在cmd里 任意目录下,执行:
python --version
应该返回python的版本信息。这时说明配置好了。
然后,再回去试
python setup.py build --compiler=mingw32 install
使用MinGW 编译python扩展模块MinGW:一个可自由使用和自由发布的Windows特定头文件和使用GNU工具集导入库的集合,
允许你生成本地的Windows程序而不需要第三方C运行时库。说白了就是在windows环境下
提供一套GNU工作环境。
1、下载mingw-get
下载地址
2、 安装gcc
mingw-get install gcc
3、安装mingw32-make
mingw-get install mingw32-make
4、添加mingw/bin到path变量中
5、指定编译器为mingw32
python setup.py build -c mingw32 install
python setup.py build --complier=mingw32 install
或者修改site.cfg中添加或修改
[build]
compiler = mingw32
或者在lib\distutils\distutils.cfg添加或修改
[build]
compiler = mingw32
上面几种方结果一样只是操作过程中影响的范围不同而已.