MycroftAI / personal-backend

WORK IN PROGRESS: A Flask personal backend alternative for running your own version of https://home.mycroft.ai
Apache License 2.0
114 stars 32 forks source link

START #50

Closed andresh0816 closed 4 years ago

andresh0816 commented 4 years ago

How can i start this backed?

el-tocino commented 4 years ago

https://github.com/MycroftAI/personal-backend/blob/master/examples/start_backend.py

andresh0816 commented 4 years ago

@el-tocino don't work

el-tocino commented 4 years ago

Why not?

krisgesling commented 4 years ago

Hi Andres, How did you call start_backend.py? Did you get any specific error messages?

andresh0816 commented 4 years ago

Yes, i call start_backend.py with python. I get this response:

name == "main" no found

in https://github.com/MycroftAI/personal-backend/blob/8a56ae3d767e7dd7664f790c59227de08ca41ec9/examples/start_backend.py#L4

el-tocino commented 4 years ago

try copying it to main directory and running it.

andresh0816 commented 4 years ago

Main directory? Be more especific please

krisgesling commented 4 years ago

By main directory I believe he means the top-level directory of the project.

eg if you cloned the project into ~/personal-backend you could run:

cd ~/personal-backend
cp examples/start_backend.py ./
python start_backend.py
andresh0816 commented 4 years ago
$ python start_backend.py
Traceback (most recent call last):
  File "start_backend.py", line 5, in <module>
    start_backend()
  File "/home/andres/anaconda3/lib/python3.7/site-packages/personal_mycroft_backend/backend/__init__.py", line 55, in start_backend
    app = create_app()
  File "/home/andres/anaconda3/lib/python3.7/site-packages/personal_mycroft_backend/backend/__init__.py", line 26, in create_app
    from personal_mycroft_backend.backend.stt import get_stt_routes
  File "/home/andres/anaconda3/lib/python3.7/site-packages/personal_mycroft_backend/backend/stt.py", line 11, in <module>
    engine = STTFactory.create()
  File "/home/andres/anaconda3/lib/python3.7/site-packages/personal_mycroft_backend/stt/__init__.py", line 228, in create
    return clazz()
  File "/home/andres/anaconda3/lib/python3.7/site-packages/personal_mycroft_backend/stt/__init__.py", line 74, in __init__
    super(GoogleSTT, self).__init__()
  File "/home/andres/anaconda3/lib/python3.7/site-packages/personal_mycroft_backend/stt/__init__.py", line 42, in __init__
    super(TokenSTT, self).__init__()
  File "/home/andres/anaconda3/lib/python3.7/site-packages/personal_mycroft_backend/stt/__init__.py", line 30, in __init__
    self.credential = self.config.get("credential", {})
AttributeError: 'NoneType' object has no attribute 'get'
krisgesling commented 4 years ago

Have you installed the python dependencies? Personally I prefer this in a venv

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
krisgesling commented 4 years ago

You will also need to configure the server as outlined here: https://github.com/MycroftAI/personal-backend#install

andresh0816 commented 4 years ago
$python start_backend.py
Traceback (most recent call last):
  File "start_backend.py", line 1, in <module>
    from personal_mycroft_backend.backend import start_backend
ModuleNotFoundError: No module named 'personal_mycroft_backend'
andresh0816 commented 4 years ago

I run that with virtualenv

andresh0816 commented 4 years ago

(env) andres@Napoleon:~/Documentos/Proyectos/web_api/examples$ python start_backend.py Traceback (most recent call last): File "start_backend.py", line 5, in start_backend() File "/home/andres/Documentos/Proyectos/web_api/env/lib/python3.7/site-packages/personal_mycroft_backend/backend/init.py", line 55, in start_backend app = create_app() File "/home/andres/Documentos/Proyectos/web_api/env/lib/python3.7/site-packages/personal_mycroft_backend/backend/init.py", line 26, in create_app from personal_mycroft_backend.backend.stt import get_stt_routes File "/home/andres/Documentos/Proyectos/web_api/env/lib/python3.7/site-packages/personal_mycroft_backend/backend/stt.py", line 11, in engine = STTFactory.create() File "/home/andres/Documentos/Proyectos/web_api/env/lib/python3.7/site-packages/personal_mycroft_backend/stt/init.py", line 228, in create return clazz() File "/home/andres/Documentos/Proyectos/web_api/env/lib/python3.7/site-packages/personal_mycroft_backend/stt/init.py", line 74, in init super(GoogleSTT, self).init() File "/home/andres/Documentos/Proyectos/web_api/env/lib/python3.7/site-packages/personal_mycroft_backend/stt/init.py", line 42, in init super(TokenSTT, self).init() File "/home/andres/Documentos/Proyectos/web_api/env/lib/python3.7/site-packages/personal_mycroft_backend/stt/init.py", line 30, in init self.credential = self.config.get("credential", {}) AttributeError: 'NoneType' object has no attribute 'get'

krisgesling commented 4 years ago

Are you running that from within the examples directory?

Probably need to copy start_backend.py to /home/andres/Documentos/Proyectos/web_api/ and run it from there.

andresh0816 commented 4 years ago

I get this:

:~/Documentos/Proyectos/web_api$ python start_backend.py
Traceback (most recent call last):
  File "start_backend.py", line 5, in <module>
    start_backend()
  File "/home/andres/Documentos/Proyectos/web_api/personal_mycroft_backend/backend/__init__.py", line 55, in start_backend
    app = create_app()
  File "/home/andres/Documentos/Proyectos/web_api/personal_mycroft_backend/backend/__init__.py", line 26, in create_app
    from personal_mycroft_backend.backend.stt import get_stt_routes
  File "/home/andres/Documentos/Proyectos/web_api/personal_mycroft_backend/backend/stt.py", line 11, in <module>
    engine = STTFactory.create()
  File "/home/andres/Documentos/Proyectos/web_api/personal_mycroft_backend/stt/__init__.py", line 228, in create
    return clazz()
  File "/home/andres/Documentos/Proyectos/web_api/personal_mycroft_backend/stt/__init__.py", line 74, in __init__
    super(GoogleSTT, self).__init__()
  File "/home/andres/Documentos/Proyectos/web_api/personal_mycroft_backend/stt/__init__.py", line 42, in __init__
    super(TokenSTT, self).__init__()
  File "/home/andres/Documentos/Proyectos/web_api/personal_mycroft_backend/stt/__init__.py", line 30, in __init__
    self.credential = self.config.get("credential", {})
AttributeError: 'NoneType' object has no attribute 'get'
krisgesling commented 4 years ago

Looks like #52 fixes this also

krisgesling commented 4 years ago

Just saw in chat that you got this working which is great.

Closing this ticket