1

我一直在尝试在我的笔记本电脑上安装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
4

2 回答 2

1

看来您正在使用使用 MinGW 构建的 Anaconda python。自述文件中提到的默认 pocketsphinx-python 应该与 MSVC python(从 python.org 分发)一起使用,因此它与 GCC python 不兼容,因为它在 setup.py 中使用了一些特定于 MSVC 的选项:

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

你有两个选择:

  1. 使用使用 MSVC 编译的 Windows 的默认 python

  2. 从 setup.py 中删除它extra_compile_args,然后该包可能会使用 MinGW gcc 构建。

于 2015-03-21T19:18:03.570 回答
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 install "pocketsphinx-0.0.9-cp35-cp35m-win32.whl"

于 2016-03-22T21:16:00.517 回答