在Fedora 21上安装M2Crypto时,我得到以下错误:
Installed /home/subho/.virtualenvs/shumgrepper/lib/python2.7/site-packages/shumgrepper-0.0.1-py2.7.egg Processing dependencies for shumgrepper==0.0.1 Searching for M2Crypto Reading https://pypi.python.org/simple/M2Crypto/ Best match: M2Crypto 0.22.3 Downloading https://pypi.python.org/packages/source/M/M2Crypto/M2Crypto-0.22.3.tar.gz#md5=573f21aaac7d5c9549798e72ffcefedd Processing M2Crypto-0.22.3.tar.gz Writing /tmp/easy_install-q3YUXp/M2Crypto-0.22.3/setup.cfg Running M2Crypto-0.22.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-q3YUXp/M2Crypto-0.22.3/egg-dist-tmp-nxDfs1 SWIG/_ssl.i:676: Error: Syntax error in input(1). error: Setup script exited with error: command 'swig' failed with exit status 1尝试遵循这里,这里中的步骤。但最新版本的pip清除了未完成的构建。另外,我尝试从pypi下载M2Crypto,提取它,但找不到任何fedora_setup.sh文件。
此外,更深入地研究setup.py in M2Crypto,我发现了以下几行。因此,他们似乎已经处理了fedora,所以显然没有单独的fedora_setup.sh文件。
# Fedora does hat tricks.
if platform.linux_distribution()[0] in ['Fedora', 'CentOS']:
if platform.architecture()[0] == '64bit':
self.swig_opts.append('-D__x86_64__')
elif platform.architecture()[0] == '32bit':
self.swig_opts.append('-D__i386__')
self.include_dirs += [os.path.join(self.openssl, opensslIncludeDir),
os.path.join(os.getcwd(), 'SWIG')]任何帮助都会很好。
发布于 2015-03-11 16:35:09
这是一个大版本的问题。最新版本的swig提供语法错误。为了克服这个问题,我改用了一个旧版本的(SWIG Version 3.0.2)。
https://stackoverflow.com/questions/28847944
复制相似问题