Windows上的Pocketsphinx-python安装错误

时间:2015-03-21 08:30:54

标签: python windows pocketsphinx

我一直在尝试在笔记本电脑上安装pocketsphinx。我已经安装了所有依赖项,仍然继续给出以下错误。 GCC.exe退出文件夹并添加到环境变量中。感谢所有帮助

Source in c:\users\archana\appdata\local\temp\pip_build_archana\pocketsphinx has version 0.0.4, which satisfies requirement pocketsphinx
Installing collected packages: pocketsphinx
  Running setup.py install for pocketsphinx
    Running command C:\Users\ARCHANA\Anaconda\python.exe -c "import setuptools, tokenize;__file__='c:\\users\\archana\\appdata\\local\\temp\\pip_build_ARCHANA\\pocketsphinx\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\archana\appdata\local\temp\pip-f_ai9e-record\install-record.txt --single-version-externally-managed --compile
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-2.7
    creating build\lib.win-amd64-2.7\sphinxbase
    copying sphinxbase\swig\python\sphinxbase.py -> build\lib.win-amd64-2.7\sphinxbase
    copying sphinxbase\swig\python\__init__.py -> build\lib.win-amd64-2.7\sphinxbase
    creating build\lib.win-amd64-2.7\pocketsphinx
    copying pocketsphinx\swig\python\pocketsphinx.py -> build\lib.win-amd64-2.7\pocketsphinx
    copying pocketsphinx\swig\python\__init__.py -> build\lib.win-amd64-2.7\pocketsphinx
    running build_ext
    building 'sphinxbase._sphinxbase' extension
    swigging sphinxbase/swig/sphinxbase.i to sphinxbase/swig/sphinxbase_wrap.c
    C:\Users\ARCHANA\Anaconda\swigwin-3.0.5\swig.exe -python -modern -Isphinxbase/include -Isphinxbase/include/sphinxbase -Isphinxbase/include/win32 -outdir sphinxbase/swig/python -o sphinxbase/swig/sphinxbase_wrap.c sphinxbase/swig/sphinxbase.i
    creating build\temp.win-amd64-2.7
    creating build\temp.win-amd64-2.7\Release
    creating build\temp.win-amd64-2.7\Release\sphinxbase
    creating build\temp.win-amd64-2.7\Release\sphinxbase\src
    creating build\temp.win-amd64-2.7\Release\sphinxbase\src\libsphinxbase
    creating build\temp.win-amd64-2.7\Release\sphinxbase\src\libsphinxbase\lm
    creating build\temp.win-amd64-2.7\Release\sphinxbase\src\libsphinxbase\feat
    creating build\temp.win-amd64-2.7\Release\sphinxbase\src\libsphinxbase\util
    creating build\temp.win-amd64-2.7\Release\sphinxbase\src\libsphinxbase\fe
    creating build\temp.win-amd64-2.7\Release\sphinxbase\src\libsphinxad
    creating build\temp.win-amd64-2.7\Release\sphinxbase\swig
    C:\Users\ARCHANA\Anaconda\Scripts\gcc.bat -DMS_WIN64 -mdll -O -Wall -DSPHINXBASE_EXPORTS -DPOCKETSPHINX_EXPORTS -DHAVE_CONFIG_H -D_CRT_SECURE_NO_DEPRECATE -D_USRDLL -DSPHINXDLL -DWIN32 -D_WINDOWS -DYY_NO_UNISTD_H -Isphinxbase/include -Isphinxbase/include/sphinxbase -Isphinxbase/include/win32 -IC:\Users\ARCHANA\Anaconda\include -IC:\Users\ARCHANA\Anaconda\PC -c sphinxbase/src/libsphinxbase/lm\fsg_model.c -o build\temp.win-amd64-2.7\Release\sphinxbase\src\libsphinxbase\lm\fsg_model.o /wd4244 /wd4090 /wd4018
    gcc.exe: error: /wd4244: No such file or directory
    gcc.exe: error: /wd4090: No such file or directory
    gcc.exe: error: /wd4018: No such file or directory
    error: command 'gcc' failed with exit status 1
    Complete output from command C:\Users\ARCHANA\Anaconda\python.exe -c "import setuptools, tokenize;__file__='c:\\users\\archana\\appdata\\local\\temp\\pip_build_ARCHANA\\pocketsphinx\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\archana\appdata\local\temp\pip-f_ai9e-record\install-record.txt --single-version-externally-managed --compile:
    running install

running build

running build_py

creating build

creating build\lib.win-amd64-2.7

creating build\lib.win-amd64-2.7\sphinxbase

copying sphinxbase\swig\python\sphinxbase.py -> build\lib.win-amd64-2.7\sphinxbase

copying sphinxbase\swig\python\__init__.py -> build\lib.win-amd64-2.7\sphinxbase

creating build\lib.win-amd64-2.7\pocketsphinx

copying pocketsphinx\swig\python\pocketsphinx.py -> build\lib.win-amd64-2.7\pocketsphinx

copying pocketsphinx\swig\python\__init__.py -> build\lib.win-amd64-2.7\pocketsphinx

running build_ext

building 'sphinxbase._sphinxbase' extension

swigging sphinxbase/swig/sphinxbase.i to sphinxbase/swig/sphinxbase_wrap.c

C:\Users\ARCHANA\Anaconda\swigwin-3.0.5\swig.exe -python -modern -Isphinxbase/include -Isphinxbase/include/sphinxbase -Isphinxbase/include/win32 -outdir sphinxbase/swig/python -o sphinxbase/swig/sphinxbase_wrap.c sphinxbase/swig/sphinxbase.i

creating build\temp.win-amd64-2.7

creating build\temp.win-amd64-2.7\Release

creating build\temp.win-amd64-2.7\Release\sphinxbase

creating build\temp.win-amd64-2.7\Release\sphinxbase\src

creating build\temp.win-amd64-2.7\Release\sphinxbase\src\libsphinxbase

creating build\temp.win-amd64-2.7\Release\sphinxbase\src\libsphinxbase\lm

creating build\temp.win-amd64-2.7\Release\sphinxbase\src\libsphinxbase\feat

creating build\temp.win-amd64-2.7\Release\sphinxbase\src\libsphinxbase\util

creating build\temp.win-amd64-2.7\Release\sphinxbase\src\libsphinxbase\fe

creating build\temp.win-amd64-2.7\Release\sphinxbase\src\libsphinxad

creating build\temp.win-amd64-2.7\Release\sphinxbase\swig

C:\Users\ARCHANA\Anaconda\Scripts\gcc.bat -DMS_WIN64 -mdll -O -Wall -DSPHINXBASE_EXPORTS -DPOCKETSPHINX_EXPORTS -DHAVE_CONFIG_H -D_CRT_SECURE_NO_DEPRECATE -D_USRDLL -DSPHINXDLL -DWIN32 -D_WINDOWS -DYY_NO_UNISTD_H -Isphinxbase/include -Isphinxbase/include/sphinxbase -Isphinxbase/include/win32 -IC:\Users\ARCHANA\Anaconda\include -IC:\Users\ARCHANA\Anaconda\PC -c sphinxbase/src/libsphinxbase/lm\fsg_model.c -o build\temp.win-amd64-2.7\Release\sphinxbase\src\libsphinxbase\lm\fsg_model.o /wd4244 /wd4090 /wd4018

gcc.exe: error: /wd4244: No such file or directory

gcc.exe: error: /wd4090: No such file or directory

gcc.exe: error: /wd4018: No such file or directory

error: command 'gcc' failed with exit status 1

----------------------------------------
Cleaning up...
  Removing temporary dir c:\users\archana\appdata\local\temp\pip_build_ARCHANA...
Command C:\Users\ARCHANA\Anaconda\python.exe -c "import setuptools, tokenize;__file__='c:\\users\\archana\\appdata\\local\\temp\\pip_build_ARCHANA\\pocketsphinx\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\archana\appdata\local\temp\pip-f_ai9e-record\install-record.txt --single-version-externally-managed --compile failed with error code 1 in c:\users\archana\appdata\local\temp\pip_build_ARCHANA\pocketsphinx
Exception information:
Traceback (most recent call last):
  File "C:\Users\ARCHANA\Anaconda\lib\site-packages\pip\basecommand.py", line 122, in main
    status = self.run(options, args)
  File "C:\Users\ARCHANA\Anaconda\lib\site-packages\pip\commands\install.py", line 279, in run
    requirement_set.install(install_options, global_options, root=options.root_path)
  File "C:\Users\ARCHANA\Anaconda\lib\site-packages\pip\req.py", line 1380, in install
    requirement.install(install_options, global_options, *args, **kwargs)
  File "C:\Users\ARCHANA\Anaconda\lib\site-packages\pip\req.py", line 699, in install
    cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
  File "C:\Users\ARCHANA\Anaconda\lib\site-packages\pip\util.py", line 697, in call_subprocess
    % (command_desc, proc.returncode, cwd))
InstallationError: Command C:\Users\ARCHANA\Anaconda\python.exe -c "import setuptools, tokenize;__file__='c:\\users\\archana\\appdata\\local\\temp\\pip_build_ARCHANA\\pocketsphinx\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\archana\appdata\local\temp\pip-f_ai9e-record\install-record.txt --single-version-externally-managed --compile failed with error code 1 in c:\users\archana\appdata\local\temp\pip_build_ARCHANA\pocketsphinx

2 个答案:

答案 0 :(得分:1)

您似乎正在使用使用MinGW构建的Anaconda python。 README中提到的默认的pocketsphinx-python应该与MSVC python一起使用(从python.org发布),所以它与GCC python不兼容,因为它在setup.py中使用了一些特定于MSVC的选项:

extra_compile_args.extend([
    '/wd4244',
    '/wd4267',
    '/wd4197',
    '/wd4090',
    '/wd4018'
])

您有两种选择:

  1. 使用使用MSVC

  2. 编译的Windows的默认python
  3. 从setup.py中删除extra_compile_args,然后该程序包可能会使用MinGW gcc构建。

答案 1 :(得分:0)

Christoph Gohlke在他的非官方扩展库中添加了一个编译版本的pocketsphinx。

如果您运行的是Python 3.5(32位),请下载:“pocketsphinx-0.0.9-cp35-cp35m-win32.whl”

此处:http://www.lfd.uci.edu/~gohlke/pythonlibs/#pocketsphinx

然后运行: pip3安装“pocketsphinx-0.0.9-cp35-cp35m-win32.whl”