Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make: python-config: Command not found #17

Closed
tiny-tinker opened this issue Jun 8, 2016 · 3 comments
Closed

make: python-config: Command not found #17

tiny-tinker opened this issue Jun 8, 2016 · 3 comments

Comments

@tiny-tinker
Copy link

Hello again,
After git clone of snowboy, I did:

cd swig/Python
make

And got these errors:

pi@raspberrypi:~/Downloads/snowboy/swig/Python $ make
make: python-config: Command not found
make: python-config: Command not found
swig -I../../ -c++ -python -o snowboy-detect-swig.cc snowboy-detect-swig.i
make: swig: Command not found
Makefile:45: recipe for target 'snowboy-detect-swig.cc' failed
make: *** [snowboy-detect-swig.cc] Error 127

I was able to get around this by running

pip install python-config
sudo apt-get install python-dev swig

Question though.... I see the set up section uses swig3.0. But when I ran make, it couldn't find swig until I installed just swig. Is there an issue with installing these 3 version of things? I see it also in the python3-pyaudio.

@chenguoguo
Copy link
Collaborator

chenguoguo commented Jun 8, 2016

Yes, you'll have to install python-dev to get the Makefile work. Regarding swig, I normally don't do apt-get install swig, as I experienced issues (the detection doesn't work properly) with swig installed from apt-get install. I usually install it from source code, using the following commands (it's not included in the Makefile):

#!/bin/bash

# SWIG is a tool to compile c++ code into Python.

echo "Installing SWIG"

if [ ! -e swig-3.0.7.tar.gz ]; then
  wget -T 10 -t 3 \
    http://prdownloads.sourceforge.net/swig/swig-3.0.7.tar.gz || exit 1;
fi

tar -xovzf swig-3.0.7.tar.gz || exit 1
ln -s swig-3.0.7 swig

cd swig

# We first have to install PCRE.
if [ ! -e pcre-8.37.tar.gz ]; then
  wget -T 10 -t 3 \
    ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.37.tar.gz || exit 1;
fi
Tools/pcre-build.sh

./configure --prefix=`pwd` --with-pic
make
make install

cd ..

If you see wired issues, you can try to install swig from source code. BTW, if you are only using the python wrapper, we do provide precompiled versions for Raspberry Pi, see here.

@tiny-tinker
Copy link
Author

Woohoo!! It works!
Yea, I removed swig and ran your script, but I did a global install, so I removed the --prefix=${pwd} (How does one escape markdown?? lol) and then changed make install to sudo make install. This raspberry will be dedicated to using this snowboy so I think that should be ok.

@stridera
Copy link

stridera commented Jul 27, 2016

if you follow the instructions (and apt-get swig3.0) you can edit the make file to do this:
SWIG := swig3.0

(was SWIG := swig)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants