1

While installing M2Crypto on Fedora 21 i am getting the following error:

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 Tried following the steps in here,here. But the latest version of pip cleans out the unfinished build. Also i tried downloading M2Crypto from pypi extracted it but couldn't find any fedora_setup.sh file.

Also, looking deeper into setup.py in M2Crypto , i find the following lines. So it seems like they have taken care of fedora OS so obviously no separate fedora_setup.sh file is there.

# 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')]

Any help would be great.

Community
  • 1
  • 1
codename_subho
  • 456
  • 8
  • 22

1 Answers1

1

This is a swig version issue. Latest version of swig gives Syntax error. I switched to an older version (SWIG Version 3.0.2) to overcome this issue.

codename_subho
  • 456
  • 8
  • 22