首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >正在尝试安装python库snudown,出现gperf错误

正在尝试安装python库snudown,出现gperf错误
EN

Stack Overflow用户
提问于 2015-08-19 09:35:57
回答 1查看 421关注 0票数 2
代码语言:javascript
复制
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

您会注意到,在gperf选项打印输出中,'output‘拼写错误。我已经尝试修改snudown的setup.py以使用我能想到的所有可能的组合,--output,--output,-o,但它仍然只给我提供用法消息。

我尝试了很多方法,但似乎都不能正常工作。

另外,如果有用的话,我正在使用的gperf副本位于

代码语言:javascript
复制
c:\python27\scripts\gperf.exe
EN

回答 1

Stack Overflow用户

发布于 2015-08-19 10:25:56

你的系统上安装了python模块gperf.py吗?我指的是这个:https://pypi.python.org/pypi/gperf

检查的一种方法是:

代码语言:javascript
复制
(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']

Window注意:此示例是在OS X上。使用适当的命令行工具。

代码语言:javascript
复制
(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

我的猜测是存放gperf.py的文件夹在您的path中,它将被执行,而不是gperf.exe。您甚至可以在gperf.py的使用说明中看到拼写错误的ouput

用法: gperf.py选项选项:-h,-i显示此帮助消息并退出-i INPUT_FILE,-h=输入文件宽度,--OUTPUT= OUTPUT_DIR --csv --OUTPUT_DIR --minor --height=HEIGHT --width=WIDTH

来源:https://pypi.python.org/pypi/gperf

如果您的系统上有pip,您可以尝试像这样卸载gperf.py

代码语言:javascript
复制
pip uninstall gperf

如果我们幸运的话,snudown的setup.py会在你的PATH上找到你的gperf.exe,并在gperf.py消失的情况下使用它。

download this:对于注释中提到的错误,编辑到

代码语言:javascript
复制
C:\\Users\\Nick\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\include\\stdint.h

然后再试一次。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32085171

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档