library pocketsphinx not downloading using pip or binary files - python

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.

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.

1. Summary
Install SWIG separately to your machine.
2. Disclaimer
This answer is relevant for April 2020. In the future, its data may be outdated.
This solution may not work on a different environment.
3. Scoop
Scoop — the simple way to install SWIG for Windows users.
scoop install swig
4. Behavior
4.1. Before
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.
4.2. After
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
5. Testing environment
Windows 10.0.18363 Pro N for Workstations 64-bit EN
Python 3.8.2
PocketSphinx 0.1.15
SWIG 4.0.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.

Related

"ERROR: CMake must be installed to build dlib" when installing face_recognition

I'm facing this error while installing face_recognition in a virtualenv with Python 3.8.10 on Ubuntu 20.04.
ERROR: Failed building wheel for face-recognition-models
Running setup.py clean for face-recognition-models
Failed to build dlib face-recognition-models
Installing collected packages: Click, numpy, dlib, face-recognition-models, face-recognition
Running setup.py install for dlib ... error
ERROR: Command errored out with exit status 1:
command: '/home/badrelden/Desktop/test python sound/venv/bin/python3' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-tai2snq9/dlib/setup.py'"'"'; __file__='"'"'/tmp/pip-install-tai2snq9/dlib/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-bhy0sde6/install-record.txt --single-version-externally-managed --compile --install-headers '/home/badrelden/Desktop/test python sound/venv/include/site/python3.8/dlib'
cwd: /tmp/pip-install-tai2snq9/dlib/
Complete output (8 lines):
running install
running build
running build_py
package init file 'tools/python/dlib/__init__.py' not found (or not a regular file)
running build_ext
ERROR: CMake must be installed to build dlib
----------------------------------------
ERROR: Command errored out with exit status 1: '/home/badrelden/Desktop/test python sound/venv/bin/python3' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-tai2snq9/dlib/setup.py'"'"'; __file__='"'"'/tmp/pip-install-tai2snq9/dlib/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-bhy0sde6/install-record.txt --single-version-externally-managed --compile --install-headers '/home/badrelden/Desktop/test python sound/venv/include/site/python3.8/dlib' Check the logs for full command output.
ERROR: CMake must be installed to build dlib
This is the key part of the error message. You need to install cmake, which can be done by running sudo apt install cmake on Debian-based systems, including Ubuntu. After cmake is installed, you can rerun the pip install command.

can't install and use pyaudio in python 3.7

C:\Users\Dell\PycharmProjects\pythonProject1>pip install pyaudio
Collecting pyaudio
Using cached PyAudio-0.2.11.tar.gz (37 kB)
Using legacy 'setup.py install' for pyaudio, since package 'wheel' is not installed.
Installing collected packages: pyaudio
Running setup.py install for pyaudio ... error
ERROR: Command errored out with exit status 1:
command: 'c:\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Dell\\AppData\\Local\\Temp\\pip-install-qm5dhs1u\\pyaud
io_0fa5615a0f1d45fe897d47e2b712cf51\\setup.py'"'"'; __file__='"'"'C:\\Users\\Dell\\AppData\\Local\\Temp\\pip-install-qm5dhs1u\\pyaudio_0fa5615a0f1d45fe897d47e2b712cf
51\\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\Dell\AppData\Local\Temp\pip-record-mst52wx_\install-record.txt' --single-version-externally-managed --compile --install-head
ers 'c:\python37\Include\pyaudio'
cwd: C:\Users\Dell\AppData\Local\Temp\pip-install-qm5dhs1u\pyaudio_0fa5615a0f1d45fe897d47e2b712cf51\
Complete output (9 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
copying src\pyaudio.py -> build\lib.win-amd64-3.7
running build_ext
building '_portaudio' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Dell\\AppData\\Local\\
Temp\\pip-install-qm5dhs1u\\pyaudio_0fa5615a0f1d45fe897d47e2b712cf51\\setup.py'"'"'; __file__='"'"'C:\\Users\\Dell\\AppData\\Local\\Temp\\pip-install-qm5dhs1u\\pyaud
io_0fa5615a0f1d45fe897d47e2b712cf51\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\python37\python.exe' -u -c 'im
port sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Dell\\AppData\\Loca
l\\Temp\\pip-install-qm5dhs1u\\pyaudio_0fa5615a0f1d45fe897d47e2b712cf51\\setup.py
'"'"'; __file__='"'"'C:\\Users\\Dell\\AppData\\Local\\Temp\\pip-install-qm5dhs1u\
\pyaudio_0fa5615a0f1d45fe897d47e2b712cf51\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.cl
ose();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Dell\AppData\Local\Temp\pip-record-mst52wx_\install-record.txt' --single-version-exte
rnally-managed --compile --install-headers 'c:\python37\Include\pyaudio' Check the logs for full command output.
you need to follow these two steps in order to install pyaudio:-
pip install pipwin
pipwin install pyaudio
I hope this resolves your problem.
As the error message says, please install the build tools:
Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
I made a program that solves this for you. I will put the code in here. It uses the os.system function to do the CMD stuff for you, just an easier way to download it.
import os
os.system('cmd /k "pip install pipwin"')
os.system('cmd /k "pipwin install PyAudio"')
Then run that and it will do it all for you, if it doesn't work on the first try, just run it again. Sometimes it has to restart CMD for pipwin to start working

Python Dbus Error while installing through pip

python -m pip install dbus-python
Collecting dbus-python
Using cached dbus-python-1.2.16.tar.gz (576 kB)
Using legacy 'setup.py install' for dbus-python, since package 'wheel' is not installed.
Installing collected packages: dbus-python
Running setup.py install for dbus-python ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\pure8\AppData\Local\Programs\Python\Python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\pure8\\AppData\\Local\\Temp\\pip-install-zphzgd3p\\dbus-python\\setup.py'"'"'; __file__='"'"'C:\\Users\\pure8\\AppData\\Local\\Temp\\pip-install-zphzgd3p\\dbus-python\\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\pure8\AppData\Local\Temp\pip-record-l_6vpx3k\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\pure8\AppData\Local\Programs\Python\Python38\Include\dbus-python'
cwd: C:\Users\pure8\AppData\Local\Temp\pip-install-zphzgd3p\dbus-python\
Complete output (5 lines):
running install
running build
creating C:\Users\pure8\AppData\Local\Temp\pip-install-zphzgd3p\dbus-python\build
creating C:\Users\pure8\AppData\Local\Temp\pip-install-zphzgd3p\dbus-python\build\temp.win-amd64-3.8
error: [WinError 193] %1 is not a valid Win32 application
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\pure8\AppData\Local\Programs\Python\Python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\pure8\\AppData\\Local\\Temp\\pip-install-zphzgd3p\\dbus-python\\setup.py'"'"'; __file__='"'"'C:\\Users\\pure8\\AppData\\Local\\Temp\\pip-install-zphzgd3p\\dbus-python\\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\pure8\AppData\Local\Temp\pip-record-l_6vpx3k\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\pure8\AppData\Local\Programs\Python\Python38\Include\dbus-python' Check the logs for full command output.
every time I try to install dbus it gives me an error, I tried installing 32 bit and 64 bit of new python updates, and they are added to PATH, but that didn't help to install dbus. Dbus is required for notify2.
I had met the same problem.
Perhaps it's not recommended to use dbus-python on the Windows.
I just move the folder /usr/local/lib/python2.7/dist-packages/dbus (Linux) to the Python2.7 folder (Windows).
And I can see the dbus in the VScode by Ctrl + mouse(left).

CMD is not installing my packages using pip

Having errors on cmd as admin trying to install new modules even re-installed python to get newest version, and keeps failing!
Modules I have tried
pip install pyaudio
pip install smtplib
AND MANY Others
Collecting pyaudio
Using cached https://files.pythonhosted.org/packages/ab/42/b4f04721c5c5bfc196ce156b3c768998ef8c0ae3654ed29ea5020c749a6b/PyAudio-0.2.11.tar.gz
Installing collected packages: pyaudio
Running setup.py install for pyaudio ... error
ERROR: Command errored out with exit status 1:
command: 'c:\program files (x86)\python37-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\marcu\\AppData\\Local\\Temp\\pip-install-9lkkindd\\pyaudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\marcu\\AppData\\Local\\Temp\\pip-install-9lkkindd\\pyaudio\\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\marcu\AppData\Local\Temp\pip-record-dwdolxb5\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\marcu\AppData\Local\Temp\pip-install-9lkkindd\pyaudio\
Complete output (9 lines):
running install
running build
running build_py
creating build
creating build\lib.win32-3.7
copying src\pyaudio.py -> build\lib.win32-3.7
running build_ext
building '_portaudio' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\program files (x86)\python37-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\marcu\\AppData\\Local\\Temp\\pip-install-9lkkindd\\pyaudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\marcu\\AppData\\Local\\Temp\\pip-install-9lkkindd\\pyaudio\\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\marcu\AppData\Local\Temp\pip-record-dwdolxb5\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
yes you must download visual c++ 14 on microsoft website(optionnal) before! try after install
update your pip also!
try this link https://www.techspot.com/downloads/6776-visual-c-redistributable-package.html

pip install python-pyaudio fails on Windows [duplicate]

This question already has answers here:
Error "Microsoft Visual C++ 14.0 is required (Unable to find vcvarsall.bat)"
(36 answers)
Closed 3 years ago.
cannot install pyaudio in command prompt.
pip install pyaudio
python -m pip install PyAudio
python pip install python-pyaudio
Collecting PyAudio
Using cached https://files.pythonhosted.org/packages/ab/42/b4f04721c5c5bfc196ce156b3c768998ef8c0ae3654ed29ea5020c749a6b/PyAudio-0.2.11.tar.gz
Installing collected packages: PyAudio
Running setup.py install for PyAudio ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Nivin\AppData\Local\Programs\Python\Python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Nivin\\AppData\\Local\\Temp\\pip-install-792muqk4\\PyAudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\Nivin\\AppData\\Local\\Temp\\pip-install-792muqk4\\PyAudio\\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\Nivin\AppData\Local\Temp\pip-record-qs3g__i9\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\Nivin\AppData\Local\Temp\pip-install-792muqk4\PyAudio\
Complete output (9 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
copying src\pyaudio.py -> build\lib.win-amd64-3.7
running build_ext
building '_portaudio' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\Nivin\AppData\Local\Programs\Python\Python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Nivin\\AppData\\Local\\Temp\\pip-install-792muqk4\\PyAudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\Nivin\\AppData\\Local\\Temp\\pip-install-792muqk4\\PyAudio\\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\Nivin\AppData\Local\Temp\pip-record-qs3g__i9\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
Installing pyaudio from source requires MSVC Build tools to be installed on the machine so you need to install it first.
Another alternative is to grab a pre-built wheel package from here and install it via pip:
pip install PyAudio‑0.2.11‑cp37‑cp37m‑win_amd64.whl

Categories

Resources