HackerShackOfficial / AI-Smart-Mirror

Smart Mirror with a smart AI πŸ€–
MIT License
537 stars 214 forks source link

Final steps in setting up AI #7

Open carruthjr opened 7 years ago

carruthjr commented 7 years ago

I can't seem to do the last steps for some weird reason. I have it all until the sudo ./setup.sh part. It doesn't work for me. Can someone help?

carruthjr commented 7 years ago

Josephs-MacBook-Air:AI-Smart-Mirror josephcarruth$ cat setup.sh

!/bin/bash

pip install virtualenv virtualenv hhsmartmirror source ./hhsmartmirror/bin/activate pip install -r requirements.txt pip install --global-option='build_ext' --global-option='-I/usr/local/include' --global-option='-L/usr/local/lib' pyaudio Josephs-MacBook-Air:AI-Smart-Mirror josephcarruth$ sudo ./setup.sh ./setup.sh: line 3: pip: command not found ./setup.sh: line 4: virtualenv: command not found ./setup.sh: line 5: ./hhsmartmirror/bin/activate: No such file or directory ./setup.sh: line 6: pip: command not found ./setup.sh: line 7: pip: command not found Josephs-MacBook-Air:AI-Smart-Mirror josephcarruth$

This is what I get when I do this, can someone tell me why? I've followed the webpage & video's instruction very closely, but why? Is there something I don't have downloaded?

atainter commented 7 years ago

Yep, make sure you install pip. http://stackoverflow.com/questions/17271319/how-to-install-pip-on-mac-os-x

carruthjr commented 7 years ago

Thank you, Aaron, I like the youtube video. This will be a really cool addition to a project. J

On Nov 18, 2016, at 11:38 AM, Aaron Tainter notifications@github.com wrote:

Yep, make sure you install pip. http://stackoverflow.com/questions/17271319/how-to-install-pip-on-mac-os-x http://stackoverflow.com/questions/17271319/how-to-install-pip-on-mac-os-x β€” You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/HackerHouseYT/AI-Smart-Mirror/issues/7#issuecomment-261593083, or mute the thread https://github.com/notifications/unsubscribe-auth/AWbTEfsZ_Q8vXC4If7r1UwTeYN3Cn0n_ks5q_eKcgaJpZM4K14FF.

carruthjr commented 7 years ago

(hhsmartmirror) Josephs-MacBook-Air:AI-Smart-Mirror josephcarruth$ sudo ./setup.sh Password: The directory '/Users/josephcarruth/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. The directory '/Users/josephcarruth/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. Collecting virtualenv Downloading virtualenv-15.1.0-py2.py3-none-any.whl (1.8MB) 100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1.8MB 553kB/s Installing collected packages: virtualenv Successfully installed virtualenv-15.1.0 Please use the system python to run this script Traceback (most recent call last): File "/Users/josephcarruth/Desktop/AI-Smart-Mirror/hhsmartmirror/bin/virtualenv", line 11, in sys.exit(main()) File "/Users/josephcarruth/Desktop/AI-Smart-Mirror/hhsmartmirror/lib/python2.7/site-packages/virtualenv.py", line 713, in main symlink=options.symlink) File "/Users/josephcarruth/Desktop/AI-Smart-Mirror/hhsmartmirror/lib/python2.7/site-packages/virtualenv.py", line 925, in create_environment site_packages=site_packages, clear=clear, symlink=symlink)) File "/Users/josephcarruth/Desktop/AI-Smart-Mirror/hhsmartmirror/lib/python2.7/posixpath.py", line 360, in abspath if not isabs(path): File "/Users/josephcarruth/Desktop/AI-Smart-Mirror/hhsmartmirror/lib/python2.7/posixpath.py", line 54, in isabs return s.startswith('/') AttributeError: 'NoneType' object has no attribute 'startswith' The directory '/Users/josephcarruth/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. The directory '/Users/josephcarruth/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. Requirement already satisfied: speechrecognition in ./hhsmartmirror/lib/python2.7/site-packages (from -r requirements.txt (line 1)) Requirement already satisfied: gtts in ./hhsmartmirror/lib/python2.7/site-packages (from -r requirements.txt (line 2)) Requirement already satisfied: py4j in ./hhsmartmirror/lib/python2.7/site-packages (from -r requirements.txt (line 3)) Requirement already satisfied: python-dateutil in ./hhsmartmirror/lib/python2.7/site-packages (from -r requirements.txt (line 4)) Requirement already satisfied: pydub in ./hhsmartmirror/lib/python2.7/site-packages (from -r requirements.txt (line 5)) Requirement already satisfied: feedparser in ./hhsmartmirror/lib/python2.7/site-packages (from -r requirements.txt (line 6)) Requirement already satisfied: numpy in ./hhsmartmirror/lib/python2.7/site-packages (from -r requirements.txt (line 7)) Requirement already satisfied: requests in ./hhsmartmirror/lib/python2.7/site-packages (from gtts->-r requirements.txt (line 2)) Requirement already satisfied: gtts_token in ./hhsmartmirror/lib/python2.7/site-packages (from gtts->-r requirements.txt (line 2)) Requirement already satisfied: six>=1.5 in ./hhsmartmirror/lib/python2.7/site-packages (from python-dateutil->-r requirements.txt (line 4)) /Users/josephcarruth/Desktop/AI-Smart-Mirror/hhsmartmirror/lib/python2.7/site-packages/pip/commands/install.py:194: UserWarning: Disabling all use of wheels due to the use of --build-options / --global-options / --install-options. cmdoptions.check_install_build_global(options) The directory '/Users/josephcarruth/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. The directory '/Users/josephcarruth/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. Collecting pyaudio Downloading PyAudio-0.2.9.tar.gz (289kB) 100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 296kB 2.3MB/s Installing collected packages: pyaudio Running setup.py install for pyaudio ... error Complete output from command /Users/josephcarruth/Desktop/AI-Smart-Mirror/hhsmartmirror/bin/python -u -c "import setuptools, tokenize;file='/private/tmp/pip-build-G3TtfC/pyaudio/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" build_ext -I/usr/local/include -L/usr/local/lib install --record /tmp/pip-8sp0Id-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/josephcarruth/Desktop/AI-Smart-Mirror/hhsmartmirror/include/site/python2.7/pyaudio: running build_ext building '_portaudio' extension creating build creating build/temp.macosx-10.12-intel-2.7 creating build/temp.macosx-10.12-intel-2.7/src cc -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -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 i386 -arch x86_64 -pipe -DMACOSX=1 -I/usr/local/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/_portaudiomodule.c -o build/temp.macosx-10.12-intel-2.7/src/_portaudiomodule.o src/_portaudiomodule.c:29:10: fatal error: 'portaudio.h' file not found

include "portaudio.h"

         ^
1 error generated.
error: command 'cc' failed with exit status 1
----------------------------------------

Command "/Users/josephcarruth/Desktop/AI-Smart-Mirror/hhsmartmirror/bin/python -u -c "import setuptools, tokenize;file='/private/tmp/pip-build-G3TtfC/pyaudio/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" build_ext -I/usr/local/include -L/usr/local/lib install --record /tmp/pip-8sp0Id-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/josephcarruth/Desktop/AI-Smart-Mirror/hhsmartmirror/include/site/python2.7/pyaudio" failed with error code 1 in /private/tmp/pip-build-G3TtfC/pyaudio/ (hhsmartmirror) Josephs-MacBook-Air:AI-Smart-Mirror josephcarruth$ python bot.py /Users/josephcarruth/Desktop/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. Used wrong endpoint for microphone debugging 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/josephcarruth/Desktop/AI-Smart-Mirror/speech.py", line 32, in listen_for_audio m = sr.Microphone() File "/Users/josephcarruth/Desktop/AI-Smart-Mirror/hhsmartmirror/lib/python2.7/site-packages/speech_recognition/init.py", line 55, in init self.pyaudio_module = self.get_pyaudio() File "/Users/josephcarruth/Desktop/AI-Smart-Mirror/hhsmartmirror/lib/python2.7/site-packages/speech_recognition/init.py", line 85, in get_pyaudio raise AttributeError("Could not find PyAudio; check installation") AttributeError: Could not find PyAudio; check installation (hhsmartmirror) Josephs-MacBook-Air:AI-Smart-Mirror josephcarruth$

This is as far as I've gotten but for some reason the PyAudio file doesn't install or something. Is there anything else I need to download? Thanks

atainter commented 7 years ago

fatal error: 'portaudio.h' file not found I would google this. The setup.sh script installs a module called pyaudio. For some reason it can't find the portaudio.h file when it installs. You could also try installing portaudio first. brew install portaudio

dropert commented 7 years ago

Had the same issue (Mac OS Sierra). Using brew to install "portaudio" solved the issue for me.

carruthjr commented 7 years ago

I tried that too, but for some reason it has never worked. I’m looking at ways to put it on a RPi right now, but I’ve been busy this winter. I’ll look into that again though.

On Jan 7, 2017, at 11:06 PM, dropert <notifications@github.com mailto:notifications@github.com> wrote:

Had the same issue (Mac OS Sierra). Using brew to install "portaudio" solved the issue for me.

β€” You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/HackerHouseYT/AI-Smart-Mirror/issues/7#issuecomment-271130364, or mute the thread https://github.com/notifications/unsubscribe-auth/AWbTER_lTZygsrfE8mcGvWUFs7a-QZDUks5rQG7jgaJpZM4K14FF.

goelakash commented 7 years ago

Thanks @dropert ! It works for me.

aniquedavla commented 7 years ago

Same. brew install portaudio solves the issue installing pyaudio on mac

aak2003 commented 6 years ago

Pip did not work for me

aak2003 commented 6 years ago

Sudo apt-get portaudio19-dev will solve the missing portaudio.h file problem

chan1di commented 6 years ago

you can also install it with ..... brew install portaudio

chhester commented 6 years ago

I haven't tried this yet (will tonight) on a Rasp Pi 3B, but it looks promising... https://www.pyimagesearch.com/2016/04/18/install-guide-raspberry-pi-3-raspbian-jessie-opencv-3/

Will let you know once I try it.

pawan-saxena commented 6 years ago

Hello everyone i managed to install everything on raspberry pi3 and there are a lot of issues that would come to your way if you try to do it on raspberry pi.I spent 8 days to work it out so please let me know if i can be of any help.

SChandel4 commented 6 years ago

@pawans-optimus I am getting error -> File "/home/pi/AI-Smart-Mirror/speech.py", line 54, in synthesize_text song = AudioSegment.from_mp3("tmp.mp3") File "/home/pi/AI-Smart-Mirror/hhsmartmirror/local/lib/python2.7/site-packages/pydub/audio_segment.py", line 532, in from_mp3 return cls.from_file(file, 'mp3', parameters) File "/home/pi/AI-Smart-Mirror/hhsmartmirror/local/lib/python2.7/site-packages/pydub/audio_segment.py", line 512, in from_file p = subprocess.Popen(conversion_command, stdin=devnull, stdout=subprocess.PIPE, stderr=subprocess.PIPE) File "/usr/lib/python2.7/subprocess.py", line 710, in init errread, errwrite) File "/usr/lib/python2.7/subprocess.py", line 1335, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory

Can you help me out here

pawan-saxena commented 6 years ago

@SChandel4 Please make sure that you have proper privileges. If you made the virtual env using a root user then you have run everything afterwards as root and vice versa. Also make sure you call bot.py from within virtual env. And if evrything fails--do a workaround --- chmod to 755 that directory

pawan-saxena commented 6 years ago

i will try to add another readme for pi boards only this weekend.

amshoo commented 6 years ago

am gating this error, can some one help: Traceback (most recent call last): File "bot.py", line 12, in from nlg import NLG File "C:\Users\USER\desktop\my-git\nlg.py", line 4, in from py4j_server import launch_py4j_server File "C:\Users\USER\desktop\my-git\py4j_server__init__.py", line 8, in from py4j.java_gateway import JavaGateway, GatewayClient, java_import ModuleNotFoundError: No module named 'py4j'

aak2003 commented 6 years ago

Try Sudo apt-get install py4j Or pip install py4j

One of them will work

On Wed, May 2, 2018, 11:39 AM auwal amshi notifications@github.com wrote:

am gating this error, can some one help: Traceback (most recent call last): File "bot.py", line 12, in from nlg import NLG File "C:\Users\USER\desktop\my-git\nlg.py", line 4, in from py4j_server import launch_py4j_server File "C:\Users\USER\desktop\my-git\py4jserverinit_.py", line 8, in from py4j.java_gateway import JavaGateway, GatewayClient, java_import ModuleNotFoundError: No module named 'py4j'

β€” You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/HackerShackOfficial/AI-Smart-Mirror/issues/7#issuecomment-385874087, or mute the thread https://github.com/notifications/unsubscribe-auth/Ae1M0Ujqm2GzCRqNY1baDSgXOQIckVY6ks5tuU22gaJpZM4K14FF .

On May 2, 2018 11:39 AM, "auwal amshi" notifications@github.com wrote:

am gating this error, can some one help: Traceback (most recent call last): File "bot.py", line 12, in from nlg import NLG File "C:\Users\USER\desktop\my-git\nlg.py", line 4, in from py4j_server import launch_py4j_server File "C:\Users\USER\desktop\my-git\py4jserverinit_.py", line 8, in from py4j.java_gateway import JavaGateway, GatewayClient, java_import ModuleNotFoundError: No module named 'py4j'

β€” You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/HackerShackOfficial/AI-Smart-Mirror/issues/7#issuecomment-385874087, or mute the thread https://github.com/notifications/unsubscribe-auth/Ae1M0Ujqm2GzCRqNY1baDSgXOQIckVY6ks5tuU22gaJpZM4K14FF .

aak2003 commented 6 years ago

Also do the following if required

  1. Run pip install py4j or easy_install py4j (don’t forget to prefix with sudo if you install Py4J system-wide on a *NIX operating system).
  2. Py4J should now be in your PYTHONPATH.
  3. The Py4J Java library is located in share/py4j/py4j0.x.jar. The exact location depends on the platform and the installation type. Some likely locations are:
    1. Either /usr/share/py4j/py4j0.x.jaror /usr/local/share/py4j/py4j0.x.jarfor system-wide install on Linux.
    2. {virtual_env_dir}/share/py4j/py4j0.x.jarfor installation in a virtual environment.
    3. C:\python27\share\py4j\py4j0.x.jarfor system-wide install on Windows.

On Wed, May 2, 2018, 11:53 AM Crazy Freaks aakaash200317@gmail.com wrote:

Try Sudo apt-get install py4j Or pip install py4j

One of them will work

On Wed, May 2, 2018, 11:39 AM auwal amshi notifications@github.com wrote:

am gating this error, can some one help: Traceback (most recent call last): File "bot.py", line 12, in from nlg import NLG File "C:\Users\USER\desktop\my-git\nlg.py", line 4, in from py4j_server import launch_py4j_server File "C:\Users\USER\desktop\my-git\py4jserverinit_.py", line 8, in from py4j.java_gateway import JavaGateway, GatewayClient, java_import ModuleNotFoundError: No module named 'py4j'

β€” You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/HackerShackOfficial/AI-Smart-Mirror/issues/7#issuecomment-385874087, or mute the thread https://github.com/notifications/unsubscribe-auth/Ae1M0Ujqm2GzCRqNY1baDSgXOQIckVY6ks5tuU22gaJpZM4K14FF .

On May 2, 2018 11:39 AM, "auwal amshi" notifications@github.com wrote:

am gating this error, can some one help: Traceback (most recent call last): File "bot.py", line 12, in from nlg import NLG File "C:\Users\USER\desktop\my-git\nlg.py", line 4, in from py4j_server import launch_py4j_server File "C:\Users\USER\desktop\my-git\py4jserverinit_.py", line 8, in from py4j.java_gateway import JavaGateway, GatewayClient, java_import ModuleNotFoundError: No module named 'py4j'

β€” You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/HackerShackOfficial/AI-Smart-Mirror/issues/7#issuecomment-385874087, or mute the thread https://github.com/notifications/unsubscribe-auth/Ae1M0Ujqm2GzCRqNY1baDSgXOQIckVY6ks5tuU22gaJpZM4K14FF .

pawan-saxena commented 6 years ago

Hi @aak2003 seems like you are lacking that will to make it work. Anyways i will definitely add another readme this weekend :-)

SanSahInnovations commented 5 years ago

Hi @saxenapawan800 plz help me As I am stuck at Bad auth/tokens parms problem Even if I had given the right creditals it doesn't work And plz tell me how to add api keys for maps and other stuff

yogawpradhana commented 5 years ago

I am stuck at python bot.py and running in OS X

(hhsmartmirror) YOGAs-MacBook-Pro:AI-Smart-Mirror yogawpradhana$ python bot.py No Java runtime present, requesting install. Traceback (most recent call last): File "bot.py", line 12, in from nlg import NLG File "/Users/yogawpradhana/AI-Smart-Mirror/AI-Smart-Mirror/nlg.py", line 7, in gateway = launch_py4j_server() File "/Users/yogawpradhana/AI-Smart-Mirror/AI-Smart-Mirror/py4j_server/init.py", line 34, in launch_py4j_server _port = int(_pid.stdout.readline()) ValueError: invalid literal for int() with base 10: ''

Is there anyone get this issue and how to fix it? Thank you in advance

PoojaAmin29 commented 4 years ago

Hello everyone i managed to install everything on raspberry pi3 and there are a lot of issues that would come to your way if you try to do it on raspberry pi.I spent 8 days to work it out so please let me know if i can be of any help.

how did you install homebrew on raspberry pi 3 for packages and pip installation please