I\'m getting something like this. Can anyone please tell me how to fix this.
C:\\Users\\krush\\Documents\\ML using Python>pip install pocketsphinx
Collect
In case you are working on anaconda navigator.
Just go to environment.
Search swig, your package will be displayed. Select the package and click on apply button.
It will also give a prompt list of other dependencies, which need to be installed with swig.
So just select all and click on apply button.
All the dependencies will be installed in your root directory of anaconda.
This worked for me, hope it helps.
You try to install pocketsphinx
with pip
, that will download and compile this module. It requires some compiling tool like swig
.
Another solution is to install a binary version of pocketsphinx
. You can download a binary version here. You have to select the correct version with respect to your installation.
To determine which one you have to download, you can run the following commands, that will tell you which version you require and whether you run a 32 or 64 bit python interpreter.
"C:\Users\krush\Anaconda3\python.exe" --version
"C:\Users\krush\Anaconda3\python.exe" -c "import struct;print(struct.calcsize('P') * 8)"
Below are some commands that you may enter once you have downloaded the correct version
"C:\Users\krush\Anaconda3\python.exe" -m pip install pocketsphinx‑0.1.3‑cp35‑cp35m‑win32.whl
"C:\Users\krush\Anaconda3\python.exe" -m pip install pocketsphinx‑0.1.3‑cp36‑cp36m‑win_amd64.whl
I was also getting same error, while installing in ubuntu 16.04, I executed following commands:
sudo apt-get install -y python python-dev python-pip build-essential swig git libpulse-dev
sudo pip install pocketsphinx
source: pocketsphinx-python
To fix the problem, I downloaded swig for windows
Copy swig.exe to the python installation folder (for ex C:/python27)
Open swigwin-3.0.12/Lib folder and copy all *.swg files to the C:/python27/lib or equivalent python path
Open swigwin-3.0.12/lib/python and copy all the files to (C:/python27/lib)
(Also make sure you have Microsoft Visual C++ Compiler for Python installed)
These steps worked for me.
There are few set of commands to resolve this. Just execute them:
sudo apt-get install -y python3 python3-dev python3-pip build-essential swig git libpulse-dev
sudo apt-get install libasound2-dev
sudo pip install pocketsphinx
what works for me is installing swing from conda and
conda install swing
if installed search where it is installed
where swing
then add that path to your environment variable