Closed ceased-ebc closed 7 years ago
Appear to be missing :
ln -s /usr/local/Cellar/opencv/$VERSION/lib/python2.7/site-packages/cv.py cv.py ln -s /usr/local/Cellar/opencv/$VERSION/lib/python2.7/site-packages/cv2.so cv2.s
Where can i get these files from?
Last login: Sat Nov 26 08:22:13 on ttys001 NA-3:MagicMirror w$ brew install portaudio ==> Downloading https://homebrew.bintray.com/bottles/portaudio-19.20140130.maver ######################################################################## 100.0% ==> Pouring portaudio-19.20140130.mavericks.bottle.1.tar.gz 🍺 /usr/local/Cellar/portaudio/19.20140130: 32 files, 490.8K NA-3:MagicMirror w$ pip install pyaudio Collecting pyaudio /Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/vendor/requests/packages/urllib3/util/ssl.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning. SNIMissingWarning /Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/vendor/requests/packages/urllib3/util/ssl.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning. InsecurePlatformWarning Using cached PyAudio-0.2.9.tar.gz Installing collected packages: pyaudio Running setup.py install for pyaudio ... error Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/n1/q9sg_45s2j714gf1pfvkw_bm0000gn/T/pip-build-1DkvjM/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 /var/folders/n1/q9sg_45s2j714gf1pfvkw_bm0000gn/T/pip-xMjvJo-record/install-record.txt --single-version-externally-managed --compile: running install running build running build_py creating build creating build/lib.macosx-10.9-intel-2.7 copying src/pyaudio.py -> build/lib.macosx-10.9-intel-2.7 running build_ext building '_portaudio' extension creating build/temp.macosx-10.9-intel-2.7 creating build/temp.macosx-10.9-intel-2.7/src cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -DMACOSX=1 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/_portaudiomodule.c -o build/temp.macosx-10.9-intel-2.7/src/_portaudiomodule.o cc -bundle -undefined dynamic_lookup -arch x86_64 -arch i386 -Wl,-F. build/temp.macosx-10.9-intel-2.7/src/_portaudiomodule.o -lportaudio -o build/lib.macosx-10.9-intel-2.7/_portaudio.so ld: warning: ignoring file /usr/local/lib/libportaudio.dylib, file was built for x86_64 which is not the architecture being linked (i386): /usr/local/lib/libportaudio.dylib running install_lib copying build/lib.macosx-10.9-intel-2.7/_portaudio.so -> /Library/Python/2.7/site-packages error: /Library/Python/2.7/site-packages/_portaudio.so: Permission denied
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/n1/q9sg_45s2j714gf1pfvkw_bm0000gn/T/pip-build-1DkvjM/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 /var/folders/n1/q9sg_45s2j714gf1pfvkw_bm0000gn/T/pip-xMjvJo-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/n1/q9sg_45s2j714gf1pfvkw_bm0000gn/T/pip-build-1DkvjM/pyaudio/ NA-3:MagicMirror w$
Navigate to the site-packages folder in the virtual environment
cd hhsmartmirror/lib/python2.7/site-packages Link the cv.py and cv2.so files and replace $VERSION with the version you found
ln -s /usr/local/Cellar/opencv/$VERSION/lib/python2.7/site-packages/cv.py cv.py ln -s /usr/local/Cellar/opencv/$VERSION/lib/python2.7/site-packages/cv2.so cv2.s Check that the files are there
ls
/////
NA-3:~ w$ cd AI-Smart-Mirror NA-3:AI-Smart-Mirror w$ source hhsmartmirror/bin/activate (hhsmartmirror) NA-3:AI-Smart-Mirror w$ python bot.py /Users/w/AI-Smart-Mirror/hhsmartmirror/lib/python2.7/site-packages/pydub/utils.py:178: RuntimeWarning: Couldn't find ffplay or avplay - defaulting to ffplay, but may not work warn("Couldn't find ffplay or avplay - defaulting to ffplay, but may not work", RuntimeWarning) Warning: OpenCV not installed. To use facial recognition, make sure you've properly configured OpenCV. Found face Traceback (most recent call last): File "bot.py", line 254, in
bot.start()
File "bot.py", line 43, in start
recognizer, audio = self.speech.listen_for_audio()
File "/Users/w/AI-Smart-Mirror/speech.py", line 32, in listen_for_audio
m = sr.Microphone()
File "/Users/w/AI-Smart-Mirror/hhsmartmirror/lib/python2.7/site-packages/speech_recognition/init.py", line 56, in init
self.pyaudio_module = self.get_pyaudio()
File "/Users/w/AI-Smart-Mirror/hhsmartmirror/lib/python2.7/site-packages/speech_recognition/init.py", line 86, in get_pyaudio
raise AttributeError("Could not find PyAudio; check installation")
AttributeError: Could not find PyAudio; check installation
(hhsmartmirror) NA-3:AI-Smart-Mirror w$ deactivate
NA-3:AI-Smart-Mirror w$ cd hhsmartmirror/lib/python2.7/site-packages
NA-3:site-packages w$ ln -s /usr/local/Cellar/opencv/$VERSION/lib/python2.7/site-packages/cv.py cv.py
ln: cv.py: Permission denied
NA-3:site-packages w$ ln -s /usr/local/Cellar/opencv/$VERSION/lib/python2.7/site-packages/cv2.so cv2.s
ln: cv2.s: Permission denied
NA-3:site-packages w$ ls
SpeechRecognition-3.5.0-py2.7.egg-info py4j
dateutil py4j-0.10.4.dist-info
easy_install.py pydub
easy_install.pyc pydub-0.16.6.dist-info
feedparser-5.2.1-py2.7.egg-info python_dateutil-2.6.0.dist-info
feedparser.py requests
feedparser.pyc requests-2.12.1.dist-info
gTTS-1.1.6-py2.7.egg-info setuptools
gTTS_token-1.1.1-py2.7.egg-info setuptools-28.8.0.dist-info
gtts six-1.10.0.dist-info
gtts_token six.py
numpy six.pyc
numpy-1.11.2.dist-info speech_recognition
pip wheel
pip-9.0.1.dist-info wheel-0.29.0.dist-info
pkg_resources