https://pypi.org/project/pyleargist/
Unix Instructions: http://www.fftw.org/fftw3_doc/Installation-on-Unix.html
-
Download the archive here: https://pypi.org/project/pyleargist/#files
-
Replace the setup.py file with this snippet below which replaces occurrences of file() with open() for Python 3 compatibility.
from setuptools import setup from setuptools.extension import Extension from Cython.Distutils import build_ext import sys, os import numpy as np version = open('VERSION.txt').read().strip() setup(name='pyleargist', version=version, description="GIST Image descriptor for scene recognition", long_description=open('README.txt').read(), classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers keywords=('image-processing computer-vision scene-recognition'), author='Olivier Grisel', author_email='[email protected]', url='http://www.bitbucket.org/ogrisel/pyleargist/src/tip/', license='PSL', package_dir={'': 'src'}, cmdclass = {"build_ext": build_ext}, ext_modules=[ Extension( 'leargist', [ 'lear_gist/standalone_image.c', 'lear_gist/gist.c', 'src/leargist.pyx', ], libraries=['m', 'fftw3f'], include_dirs=[np.get_include(), 'lear_gist',], extra_compile_args=['-DUSE_GIST', '-DSTANDALONE_GIST'], ), ], )
-
Run
python setup.py build
If this gives you the errorgcc exited with status 1
scroll up to see if theleargist.pxd
file is missing. If it is missing in thesrc
directory, download it from Bitbucket Once you do this, runpython setup.py build
again. Now this step should succeed. -
Run
sudo python setup.py install
. If you get an error for Cython.Distutils not being found, check whether you're using the right version of Python usingwhich python
. Alternatively, sometimes sudo picks up the wrong Python path, so give it the Python3 absolute path. For e.g.,
sudo /home/user/anaconda3/bin/python setup.py install
.
This was super helpful, thank you so much.
You really saved the day for me!