安装 libmemcached 时 gcc 失败,退出状态为 1
尝试遵循 http://code.google.com/p/ 上的 python-libmemcached 说明时python-libmemcached/ 我在第 3 步遇到了麻烦(“python setup.py install”),
(gigmash_venv)m:python-libmemcached matthewparrilla$ python setup.py build
running build
running build_py
creating build
creating build/lib.macosx-10.3-fat-2.7
copying cmemcached.py -> build/lib.macosx-10.3-fat-2.7
running build_ext
building 'cmemcached_imp' extension
creating build/temp.macosx-10.3-fat-2.7
gcc-4.0 -fno-strict-aliasing -fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386 -g -O2 -DNDEBUG -g -O3 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c cmemcached_imp.c -o build/temp.macosx-10.3-fat-2.7/cmemcached_imp.o
powerpc-apple-darwin9-gcc-4.0.1: cmemcached_imp.c: No such file or directory
powerpc-apple-darwin9-gcc-4.0.1: no input files
i686-apple-darwin9-gcc-4.0.1: cmemcached_imp.c: No such file or directory
i686-apple-darwin9-gcc-4.0.1: no input files
lipo: can't figure out the architecture type of: /var/folders/0o/0oHT3RmJF80rpIJtdbegzE+++TI/-Tmp-//cc9xQqQ6.out
error: command 'gcc-4.0' failed with exit status 1
我几乎不知道这意味着什么或该怎么做。我的电脑上确实有多个版本的 gcc(4.0 和 4.2),并且通过谷歌搜索收集到了足够的信息,这可能很重要。否则就完全输了。
提前致谢。
[编辑:在遵循@phihag的指示之后]
我现在收到一个完全不同但仍然令人困惑的错误:
(gigmash_venv)m:python-libmemcached matthewparrilla$ python setup.py build
running build
running build_py
running build_ext
building 'cmemcached_imp' extension
gcc-4.0 -fno-strict-aliasing -fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386 -g -O2 -DNDEBUG -g -O3 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c cmemcached_imp.c -o build/temp.macosx-10.3-fat-2.7/cmemcached_imp.o
cmemcached_imp.c:237:36:cmemcached_imp.c:237:36: error: error: libmemcached/memcached.h: No such file or directory
libmemcached/memcached.h: No such file or directory
In file included from cmemcached_imp.c:238:
split_mc.h:14: warning: ‘struct memcached_st’ declared inside parameter list
split_mc.h:14: warning: its scope is only this definition or declaration, which is probably not what you want
split_mc.h:17: warning: ‘struct memcached_st’ declared inside parameter list
In file included from cmemcached_imp.c:238:
split_mc.h:14: warning: ‘struct memcached_st’ declared inside parameter list
(and this goes on for many many more lines)...
While trying to follow the python-libmemcached instructions at http://code.google.com/p/python-libmemcached/ I run into trouble at step 3 ("python setup.py install")
(gigmash_venv)m:python-libmemcached matthewparrilla$ python setup.py build
running build
running build_py
creating build
creating build/lib.macosx-10.3-fat-2.7
copying cmemcached.py -> build/lib.macosx-10.3-fat-2.7
running build_ext
building 'cmemcached_imp' extension
creating build/temp.macosx-10.3-fat-2.7
gcc-4.0 -fno-strict-aliasing -fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386 -g -O2 -DNDEBUG -g -O3 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c cmemcached_imp.c -o build/temp.macosx-10.3-fat-2.7/cmemcached_imp.o
powerpc-apple-darwin9-gcc-4.0.1: cmemcached_imp.c: No such file or directory
powerpc-apple-darwin9-gcc-4.0.1: no input files
i686-apple-darwin9-gcc-4.0.1: cmemcached_imp.c: No such file or directory
i686-apple-darwin9-gcc-4.0.1: no input files
lipo: can't figure out the architecture type of: /var/folders/0o/0oHT3RmJF80rpIJtdbegzE+++TI/-Tmp-//cc9xQqQ6.out
error: command 'gcc-4.0' failed with exit status 1
I have next to no idea what this means or what to do. I do have multiple versions of gcc on my comp (4.0 and 4.2) and have gleaned enough from googling it that that might matter. Totally lost otherwise.
Thanks in advance.
[Edit: After following @phihag's instructions]
I'm now receiving an altogether different though still confusing error:
(gigmash_venv)m:python-libmemcached matthewparrilla$ python setup.py build
running build
running build_py
running build_ext
building 'cmemcached_imp' extension
gcc-4.0 -fno-strict-aliasing -fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386 -g -O2 -DNDEBUG -g -O3 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c cmemcached_imp.c -o build/temp.macosx-10.3-fat-2.7/cmemcached_imp.o
cmemcached_imp.c:237:36:cmemcached_imp.c:237:36: error: error: libmemcached/memcached.h: No such file or directory
libmemcached/memcached.h: No such file or directory
In file included from cmemcached_imp.c:238:
split_mc.h:14: warning: ‘struct memcached_st’ declared inside parameter list
split_mc.h:14: warning: its scope is only this definition or declaration, which is probably not what you want
split_mc.h:17: warning: ‘struct memcached_st’ declared inside parameter list
In file included from cmemcached_imp.c:238:
split_mc.h:14: warning: ‘struct memcached_st’ declared inside parameter list
(and this goes on for many many more lines)...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
发生错误的原因是文件
cmemcached_imp.c
不存在,但必须在此步骤中进行编译。首先,编辑文件
cmemcached_imp.pyx
并修复第 506 行中的拼写错误。而不是,它应该显示
然后,安装 cython 并执行
cython 应该静默生成文件
cmemcached_imp.c
。虽然这将修复立即错误,但您可能还需要将
setup.py
替换为In response to the edit:
If you follow the instructions verbatim, you'll 另外需要在本地安装 libmemcached目录。 在 python-libmemcached 中执行
来实现这一点。
The error occurs because the file
cmemcached_imp.c
is not there, but must be compiled in this step.First, edit the file
cmemcached_imp.pyx
and fix the typo in line 506. Instead of, it should say
Then, install cython and execute
cython should silently generate the file
cmemcached_imp.c
.While this will fix the immediate error, you may also need to replace
in
setup.py
withIn response to the edit:
If you follow the instructions verbatim, you'll additionally need to have libmemcached in your local directory. Execute
in python-libmemcached to achieve that.