[英]Mysql for Python compiler MinGW32 gcc.exe error: CreateProcess file or directory not found
I'm trying to get Django/Python to work with MySQL, so I'm installing Mysql for Python adapter. 我试图让Django / Python与MySQL一起使用,所以我正在安装Mysql for Python适配器。
At one point, I discovered that I needed to use the MinGW compiler, so I installed that. 有一次,我发现我需要使用MinGW编译器,因此我安装了它。 I encountered many annoying problems, and I managed to get past them. 我遇到了许多烦人的问题,并且设法克服了这些问题。 This one, however, is especially torturing. 然而,这一点尤其令人折磨。
The error occurs when I attempt to execute the following command in command line for Windows: 当我尝试在Windows的命令行中执行以下命令时,发生错误:
setup.py install build --compiler=mingw32 setup.py安装构建--compiler = mingw32
Here is the error: 这是错误:
> running install<br> running build<br> running build_py<br> copying
> MySQLdb\release.py -> build\lib.win32-2.7\MySQLdb<br> running
> build_ext<br> building '_mysql' extension<br> gcc.exe -mno-cygwin
> -mdll -O -Wall -Dversion_info=(1,2,3,'final',0) -D__version_
> _=1.2.3 -IC:\Server\MySQL\include -IC:\Python27\include -IC:\Python27\PC -c _mys ql.c -o build\temp.win32-2.7\Release\_mysql.o /Z1<br>
> **gcc: /Z1: No such file or directory<br> gcc: CreateProcess: No such file or directory<br> error: command 'gcc' failed with exit status 1**
Can any of you guys help me out? 你们可以帮我吗?
This error is caused by /Zl parameter, as they are special parameters used only by VC. 此错误是由/ Zl参数引起的,因为它们是仅由VC使用的特殊参数。 We could delete them on setup_window.py
. 我们可以在setup_window.py
上删除它们。
Using compiled binaries for windows machine helps. 为Windows计算机使用编译的二进制文件有帮助。 you can get it here http://sourceforge.net/projects/mysql-python/files/mysql-python/1.2.3/ 您可以在这里获得它http://sourceforge.net/projects/mysql-python/files/mysql-python/1.2.3/
Since you're talking about MinGW, I'm assuming you're building on Windows. 既然您在谈论MinGW,我假设您是在Windows上构建的。 You probably need to add the directory where mingw's gcc binary resides to your PATH. 您可能需要将mingw的gcc二进制文件所在的目录添加到PATH。
Assuming it's C:\\MinGW32, then you'd do something like: 假设它是C:\\ MinGW32,那么您将执行以下操作:
set PATH=C:\MinGW32\bin;%PATH%
You'd do that before you ran python setup.py install build --compiler=mingw32
您需要先运行python setup.py install build --compiler=mingw32
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.