Reputation: 13
I am working on a speech recognition software and wanted to test out pocketsphinx and have tried to install it using pip on windows 10 python version 3.8 and it wont download usually i would fix the problem by downloading it as binary file and then trying to install it but it tells me that the whl file is unsupported and thank you all in advance.
Down below is the error message I got.
ERROR: Command errored out with exit status 1:
command: 'C:\Users\yeetgod\AppData\Local\Programs\Python\Python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\yeetgod\\AppData\\Local\\Temp\\pip-install-aims1y79\\pocketsphinx\\setup.py'"'"'; __file__='"'"'C:\\Users\\yeetgod\\AppData\\Local\\Temp\\pip-install-aims1y79\\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\yeetgod\AppData\Local\Temp\pip-record-fcvz7sp8\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\yeetgod\AppData\Local\Temp\pip-install-aims1y79\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\yeetgod\AppData\Local\Programs\Python\Python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\yeetgod\\AppData\\Local\\Temp\\pip-install-aims1y79\\pocketsphinx\\setup.py'"'"'; __file__='"'"'C:\\Users\\yeetgod\\AppData\\Local\\Temp\\pip-install-aims1y79\\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\yeetgod\AppData\Local\Temp\pip-record-fcvz7sp8\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
I expected the binary files to work but the gave me this error message
ERROR: pocketsphinx-0.1.15-cp36-cp36m-win32.whl is not a supported wheel on this platform.
And then i tried another binary file (the win64 amd one) and it gave me this error:
ERROR: pocketsphinx-0.1.15-cp36-cp36m-win_amd64.whl is not a supported wheel on this platform.
Upvotes: 1
Views: 1907
Reputation: 1
This is the second time I'm coming across this error today, the first was with pyaudio. What i did was I went to https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio, looked for the wheels I wanted to download for pyaudio and pocketsphinx (I use Python 3.8.2 on a Windows 10 so I downloaded the cp-38-cp-38_win_amd64 wheels). After downloading you simply run pip install path/to/downloaded/wheel
.
Upvotes: 0
Reputation: 2813
Install SWIG separately to your machine.
This answer is relevant for April 2020. In the future, its data may be outdated.
This solution may not work on a different environment.
Scoop — the simple way to install SWIG for Windows users.
scoop install swig
D:\SashaDebugging\KiraMicrophone>pip install pocketsphinx
Collecting pocketsphinx
Using cached pocketsphinx-0.1.15.tar.gz (29.1 MB)
Installing collected packages: pocketsphinx
Running setup.py install for pocketsphinx … error
ERROR: Command errored out with exit status 1:
command: 'c:\python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\SashaChernykh\\AppData\\Local\\Temp\\pip-install-n5cb82uz\\pocketsphinx\\setup.py'"'"'; __file__='"'"'C:\\Users\\SashaChernykh\\AppData\\Local\\Temp\\pip-install-n5cb82uz\\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\SashaChernykh\AppData\Local\Temp\pip-record-dq_syyxw\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\python38\Include\pocketsphinx'
cwd: C:\Users\SashaChernykh\AppData\Local\Temp\pip-install-n5cb82uz\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:\python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\SashaChernykh\\AppData\\Local\\Temp\\pip-install-n5cb82uz\\pocketsphinx\\setup.py'"'"'; __file__='"'"'C:\\Users\\SashaChernykh\\AppData\\Local\\Temp\\pip-install-n5cb82uz\\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\SashaChernykh\AppData\Local\Temp\pip-record-dq_syyxw\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\python38\Include\pocketsphinx' Check the logs for full command output.
D:\SashaDebugging\KiraMicrophone>pip install pocketsphinx
Collecting pocketsphinx
Using cached pocketsphinx-0.1.15.tar.gz (29.1 MB)
Installing collected packages: pocketsphinx
Running setup.py install for pocketsphinx … done
Successfully installed pocketsphinx-0.1.15
I launched simple LiveSpeech script:
from pocketsphinx import LiveSpeech
for phrase in LiveSpeech(): print(phrase)
PocketSphinx worked for me:
D:\SashaDebugging\KiraMicrophone>python KiraPocketSphinx.py
Allocating 32 buffers of 2500 samples each
test
Upvotes: 1
Reputation: 94397
ERROR: pocketsphinx-0.1.15-cp36-cp36m-win32.whl is not a supported wheel on this platform
You're trying to install a wheel for Python 3.6 to Python 3.8. That doesn't work.
The latest release of pocketsphinx was released at Jun 4, 2018, more than a year ago. Python 3.8 didn't exist at that time so they don't provide wheels for it.
Actually they don't even have wheels for Python 3.7. Either you have to use Python 3.6 or compile the project from sources. To compile from sources you need a number of prerequisites.
The error
error: command 'swig.exe' failed: No such file or directory
means that you miss one of the prerequisites — SWIG.
Upvotes: 2