简体   繁体   English

MySQL for Python编译器MinGW32 gcc.exe错误:找不到CreateProcess文件或目录

[英]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.

相关问题 错误:命令“ c:\\\\ mingw \\\\ bin \\\\ gcc.exe”失败,退出状态为1 - error: command 'c:\\mingw\\bin\\gcc.exe' failed with exit status 1 安装MinGW 64bit以用于Kivy-解压缩的文件不包含带有“ gcc.exe”的“ bin”文件夹 - Install MinGW 64bit For Use With Kivy - Unzipped file does not contain “bin” folder with “gcc.exe” 尝试使用distutils为mingw32交叉编译SWIG Python扩展时出错 - Error when trying to cross-compile SWIG Python extension for mingw32 using distutils Pystan -- Library\\mingw-w64\\bin\\gcc.exe' 失败,退出代码为 1 - Pystan -- Library\\mingw-w64\\bin\\gcc.exe' failed with exit code 1 在Windows上通过MINGW32在Python中进行系统调用 - System Call in Python via MINGW32 on Windows python - 获取Pip在Windows上使用MinGW32? - python - Getting Pip to use MinGW32 on Windows? Python 2.7 Windows 7安装mysqllib mingw32 - python 2.7 windows 7 installing mysqllib mingw32 在Windows上使用gcc(mingw32)从命令行编译Cython扩展 - Compile Cython extensions from the command line with gcc (mingw32) on windows SWIG,mingw32,distutils的问题 - Problems with SWIG, mingw32, distutils 无法在 cygwin 或 dos 命令提示符下使用 Python 3.2 和 MinGW32 安装 Cython - Cannot install Cython with Python 3.2 and MinGW32 under cygwin or under dos comandprompt
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM