whatsapp-framework icon indicating copy to clipboard operation
whatsapp-framework copied to clipboard

./start.sh Crashed

Open modcastro opened this issue 6 years ago • 6 comments

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

modcastro avatar Nov 06 '18 12:11 modcastro

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 avatar Nov 06 '18 22:11 jafrancov

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

jafrancov avatar Nov 06 '18 22:11 jafrancov

Hi!

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

  • install pyenv: brew install pyenv
  • install python 3.5.0: pyenv install 3.5.0
  • set this in your .bashrc or .zshrc eval "$(pyenv init -)"
  • Open a new terminal tab and set python global version: pyenv global 3.5.0
  • clean previous setup: sudo ./clean.sh
  • Re-run the setup script sudo ./setup.sh
  • register your number and follow the readme instructions
  • Run the server sudo ./start.sh

Hope it helps.

horozco avatar Nov 15 '18 15:11 horozco

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

modcastro avatar Dec 16 '18 11:12 modcastro

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 avatar Dec 30 '18 21:12 hurradieweltgehtunter

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

hurradieweltgehtunter avatar Dec 30 '18 22:12 hurradieweltgehtunter