Attempting to install python library snudown, get gperf error

655 views Asked by At
C:\Users\Nick\Documents\prog\python\snudown>python setup.py install
running install
running bdist_egg
running egg_info
writing snudown.egg-info\PKG-INFO
writing top-level names to snudown.egg-info\top_level.txt
writing dependency_links to snudown.egg-info\dependency_links.txt
reading manifest file 'snudown.egg-info\SOURCES.txt'
writing manifest file 'snudown.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_ext
Usage: gperf [options]

Options:
  -h, --help            show this help message and exit
  -i INPUT_FILE, --input=INPUT_FILE
  -o OUTPUT_DIR, --ouput=OUTPUT_DIR
  --csv
  --stat
  --minor
  --height=HEIGHT
  --width=WIDTH
Traceback (most recent call last):
  File "setup.py", line 50, in <module>
    include_dirs=['src', 'html']
  File "C:\Python27\lib\distutils\core.py", line 151, in setup
    dist.run_commands()
  File "C:\Python27\lib\distutils\dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
    cmd_obj.run()
  File "C:\Python27\lib\site-packages\setuptools\command\install.py", line 67, in run
    self.do_egg_install()
  File "C:\Python27\lib\site-packages\setuptools\command\install.py", line 109, in do_egg_install
    self.run_command('bdist_egg')
  File "C:\Python27\lib\distutils\cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
    cmd_obj.run()
  File "C:\Python27\lib\site-packages\setuptools\command\bdist_egg.py", line 160, in run
    cmd = self.call_command('install_lib', warn_dir=0)
  File "C:\Python27\lib\site-packages\setuptools\command\bdist_egg.py", line 146, in call_command
    self.run_command(cmdname)
  File "C:\Python27\lib\distutils\cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
    cmd_obj.run()
  File "C:\Python27\lib\site-packages\setuptools\command\install_lib.py", line 10, in run
    self.build()
  File "C:\Python27\lib\distutils\command\install_lib.py", line 111, in build
    self.run_command('build_ext')
  File "C:\Python27\lib\distutils\cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
    cmd_obj.run()
  File "setup.py", line 35, in run
    process_gperf_file("src/html_entities.gperf", "src/html_entities.h")
  File "setup.py", line 21, in process_gperf_file
    subprocess.check_call(["gperf", gperf_file, "--ouput=%s" % output_file])
  File "C:\Python27\lib\subprocess.py", line 540, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['gperf', 'src/html_entities.gperf', '--ouput=src/html_entities.h']' returned non-zero exit status 2

You'll notice in the gperf options printout, 'output' is misspelled. I have tried modifying snudown's setup.py to use every possible combination I could think of, --output, --ouput, -o, but it still just gives me the usage message.

I've tried many things, and can't seem to get it to work.

Also, if it helps, the copy of gperf I'm using is at

c:\python27\scripts\gperf.exe
1

There are 1 answers

4
Joe Young On

Do you have a python module gperf.py installed on your system? I'm referring to this one: https://pypi.python.org/pypi/gperf

One way to check:

(gperf)macbook:gperf joeyoung$ python

>>> import gperf
>>> print gperf.__file__
/Users/joeyoung/.virtualenvs/gperf/lib/python2.7/site-packages/gperf/__init__.pyc
>>> print gperf.__path__
['/Users/joeyoung/.virtualenvs/gperf/lib/python2.7/site-packages/gperf']

Note: This example is on OS X. Use appropriate Windows command line tools.

(gperf)macbook:gperf joeyoung$ cd /Users/joeyoung/.virtualenvs/gperf/lib/python2.7/site-packages/gperf
(gperf)macbook:gperf joeyoung$ ls -al
total 40
drwxr-xr-x   6 joeyoung  staff   204 Aug 19 04:14 .
drwxr-xr-x  14 joeyoung  staff   476 Aug 19 04:14 ..
-rw-r--r--   1 joeyoung  staff     0 Aug 19 04:14 __init__.py
-rw-r--r--   1 joeyoung  staff   184 Aug 19 04:14 __init__.pyc
-rw-r--r--   1 joeyoung  staff  7928 Aug 19 04:14 gperf.py
-rw-r--r--   1 joeyoung  staff  7656 Aug 19 04:14 gperf.pyc

My guess is that the folder housing gperf.py is in your path and it's getting executed instead of gperf.exe. You can even see the misspelling ouput in the usage instructions of gperf.py:

Usage: gperf.py [options]

Options:
  -h, --help            show this help message and exit
  -i INPUT_FILE, --input=INPUT_FILE
  -o OUTPUT_DIR, --ouput=OUTPUT_DIR
  --csv
  --stat
  --minor
  --height=HEIGHT
  --width=WIDTH

Source: https://pypi.python.org/pypi/gperf

If you have pip on your system, you can try to uninstall gperf.py like this:

pip uninstall gperf

If we're lucky, snudown's setup.py will find your gperf.exe on your PATH and use that instead with gperf.py gone.

Edit: For the error mentioned in the comments, download this to

C:\\Users\\Nick\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\include\\stdint.h

then give it another try.