danielcardeenas / whatsapp-framework

⚗️Whatsapp python api
1.16k stars 363 forks source link

./start.sh Crashed #222

Open modcastro opened 5 years ago

modcastro commented 5 years ago

Hi, I try start after install and receive:

SyntaxError: invalid syntax Whatsapp bot crashed with code 1. Respawning.. Traceback (most recent call last): File "run.py", line 9, in from app.layer import MacLayer File "/Users/mauricio/Documents/GitHub/whatsapp-framework/app/init.py", line 1, in import modules File "/Users/mauricio/Documents/GitHub/whatsapp-framework/modules/init.py", line 1, in from modules.hihelp import hihelp File "/Users/mauricio/Documents/GitHub/whatsapp-framework/modules/hihelp/hihelp.py", line 1, in from app.mac import mac, signals File "/Users/mauricio/Documents/GitHub/whatsapp-framework/app/mac/mac.py", line 278 async=True) ^ SyntaxError: invalid syntax

Thanks for any help

jafrancov commented 5 years ago

Same here, that first error can be fixed by removing the async=True, however, the error is in yowsup as this follows:

File "/Users/jafrancov/dev/python/whatsapp-bot/lib/python3.7/site-packages/yowsup2-2.5.2-py3.7.egg/yowsup/layers/protocol_media/mediauploader.py", line 19
    def __init__(self, jid, accountJid, sourcePath, uploadUrl, resumeOffset = 0, successClbk = None, errorClbk = None, progressCallback = None, async = True):
jafrancov commented 5 years ago

It looks like async is now a reserved word in Python 3.7+

horozco commented 5 years ago

Hi!

The issue is related to the Python version. It should be 3.5.0. Just follow the next steps:

Hope it helps.

modcastro commented 5 years ago

First Start and number has already been banned, even sent a message. @horozco

hurradieweltgehtunter commented 5 years ago

Hi @horozco Thanks for your solution but it crashes:

Traceback (most recent call last):
  File "run.py", line 5, in <module>
    from yowsup.layers.auth import AuthError
  File "/Users/me/.pyenv/versions/3.5.0/lib/python3.5/site-packages/yowsup2-2.5.2-py3.5.egg/yowsup/layers/auth/__init__.py", line 2, in <module>
    from .layer_authentication import YowAuthenticationProtocolLayer
  File "/Users/me/.pyenv/versions/3.5.0/lib/python3.5/site-packages/yowsup2-2.5.2-py3.5.egg/yowsup/layers/auth/layer_authentication.py", line 4, in <module>
    from yowsup.common.tools import TimeTools
  File "/Users/me/.pyenv/versions/3.5.0/lib/python3.5/site-packages/yowsup2-2.5.2-py3.5.egg/yowsup/common/tools.py", line 3, in <module>
    from dateutil import tz
ImportError: No module named 'dateutil'
Whatsapp bot crashed with code 1.  Respawning..

Any idea?

hurradieweltgehtunter commented 5 years ago

Oh nevermind, i installed the dateutil package with pip install python-dateutil and it works! Thanks!