我使用conda-forge in this way在Anaconda上安装了pcketsphinx。
conda install -c conda-forge pocketsphinx
然后我收到以下消息
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
PackagesNotFoundError: The following packages are not available from current channels:
- pocketsphinx
Current channels:
- https://conda.anaconda.org/conda-forge/win-64
- https://conda.anaconda.org/conda-forge/noarch
- https://repo.anaconda.com/pkgs/main/win-64
- https://repo.anaconda.com/pkgs/main/noarch
- https://repo.anaconda.com/pkgs/r/win-64
- https://repo.anaconda.com/pkgs/r/noarch
- https://repo.anaconda.com/pkgs/msys2/win-64
- https://repo.anaconda.com/pkgs/msys2/noarch
To search for alternate channels that may provide the conda package you're
looking for, navigate to
https://anaconda.org
and use the search bar at the top of the page.
为什么说“当前频道无法提供以下软件包:”?
我如何使我可以使用Pocketsphinx?
我也尝试了pip安装,但出现错误。
pip install pocketsphinx
ERROR: Command errored out with exit status 1:
command: 'C:\Users\taichi\Anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\taichi\\AppData\\Local\\Temp\\pip-install-ha8v9dja\\pocketsphinx\\setup.py'"'"'; __file__='"'"'C:\\Users\\taichi\\AppData\\Local\\Temp\\pip-install-ha8v9dja\\pocketsphinx\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\taichi\AppData\Local\Temp\pip-wheel-2isplwue' --python-tag cp37
cwd: C:\Users\taichi\AppData\Local\Temp\pip-install-ha8v9dja\pocketsphinx\
Complete output (6 lines):
running bdist_wheel
running build_ext
building 'sphinxbase._sphinxbase' extension
swigging deps/sphinxbase/swig/sphinxbase.i to deps/sphinxbase/swig/sphinxbase_wrap.c
swig.exe -python -modern -threads -Ideps/sphinxbase/include -Ideps/sphinxbase/include/sphinxbase -Ideps/sphinxbase/include/win32 -Ideps/sphinxbase/swig -outdir sphinxbase -o deps/sphinxbase/swig/sphinxbase_wrap.c deps/sphinxbase/swig/sphinxbase.i
error: command 'swig.exe' failed: No such file or directory
----------------------------------------
ERROR: Failed building wheel for pocketsphinx
Running setup.py clean for pocketsphinx
Failed to build pocketsphinx
Installing collected packages: pocketsphinx
Running setup.py install for pocketsphinx ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\taichi\Anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\taichi\\AppData\\Local\\Temp\\pip-install-ha8v9dja\\pocketsphinx\\setup.py'"'"'; __file__='"'"'C:\\Users\\taichi\\AppData\\Local\\Temp\\pip-install-ha8v9dja\\pocketsphinx\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\taichi\AppData\Local\Temp\pip-record-8osso05j\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\taichi\AppData\Local\Temp\pip-install-ha8v9dja\pocketsphinx\
Complete output (6 lines):
running install
running build_ext
building 'sphinxbase._sphinxbase' extension
swigging deps/sphinxbase/swig/sphinxbase.i to deps/sphinxbase/swig/sphinxbase_wrap.c
swig.exe -python -modern -threads -Ideps/sphinxbase/include -Ideps/sphinxbase/include/sphinxbase -Ideps/sphinxbase/include/win32 -Ideps/sphinxbase/swig -outdir sphinxbase -o deps/sphinxbase/swig/sphinxbase_wrap.c deps/sphinxbase/swig/sphinxbase.i
error: command 'swig.exe' failed: No such file or directory
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\taichi\Anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\taichi\\AppData\\Local\\Temp\\pip-install-ha8v9dja\\pocketsphinx\\setup.py'"'"'; __file__='"'"'C:\\Users\\taichi\\AppData\\Local\\Temp\\pip-install-ha8v9dja\\pocketsphinx\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\taichi\AppData\Local\Temp\pip-record-8osso05j\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
我正在使用Anaconda3和Python 3.7.4和Windows 10 64bit。
我遇到了看起来相同的问题,并可以通过以下步骤解决它。希望这对您和其他人至少有帮助。考虑以下一般要点:
gcc
正在选择所需的编译器。要查看您拥有哪些编译器,请启动一个终端窗口,键入gcc+TAB
(gcc,然后是一个选项卡)。这应该显示您系统上的所有版本。键入gcc --version
以查看默认版本。和which gcc
找出它的位置,例如/Users/PatrickT/miniconda/bin/gcc
PATH
可以找到您的编译器。这可以通过在您的bash配置文件中添加导出命令来完成。显然,在Catalina上,bash配置文件信息将放置在.zshrc
中。要查找此文件,请键入COMMAND+SHIFT+E
以使不可见的文件可见,并查看您的主目录(本例中为/Users/PatrickT
)。例如,添加类似export PATH="/usr/local/gcc-10/bin:$PATH"
的行。该路径当然取决于您的系统。 为了确保miniconda不会造成干扰,我将其完全从PATH中删除。我还从苹果二进制文件中安装了最新版本的xcode。一旦有了系统找到的gcc编译器的更新版本,就可以安装pocketsphinx
以及遇到问题的其他程序,例如kaldi
或zlib
。
让miniconda在不干扰gcc的情况下再次工作是我尚未解决的问题。一旦将miniconda放回PATH,默认的gcc就会恢复为miniconda版本。待续...