How to install a WhatsApp bot based on Python

First, we need to download the yowsup code:

git clone
cd yowsup
sudo python install
python yowsup-cli registration -p 569xxxxxxxx -C 56 -r sms

Where 56 is the country code (Chile in my case)
You will receive a code in your phone to register the account

python yowsup-cli registration -p 569xxxxxxxx -C 56 --register 201-124

Now, create a file called mydetails with the following information and the password that yowsup-cli prints:


To send a whatsapp message, you only need write the following sentence:

yowsup-cli demos -c mydetails -s 569xxxxxxxx "hello world"

If you prefer the CLI, you need to do the following:

yowsup-cli demos --yowsup --config mydetails 
/message send 569xxxxxxxx "hello world"

Enjoy it!


  1. hi my friend. when i try this ...
    python yowsup-cli registration -p 5598981818780 -C 55 -r sms

    the centos 7 show me

    status: fail
    reason: old_version
    login: 559881818780

    my wattsup version is 2.17.223

    please my friend help!!

    thanks a lot.
    you are great!!

    1. Hey Tad, had the same issue myself. All you need to do is cd into the /env directory and edit (vim, nano, whatever) the and as follows:

      1. In - change/ensure the default environment is "s40":
      i.e. DEFAULT = "s40"; and

      2. In - change/ensure the MD5 classes and version details are as follows:
      MD5_CLASSES = "1I2weuZmVg+uL50+HXeSJw=="
      VERSION = "2.16.328"

      Even though s40 is set as default environment per our changes to the file (as above), make sure to use the --env s40 switch/option in your yousup-cli registration command just to be sure it uses the right env file/settings.

      There is more info/help about this issue here -

      Good luck buddy.


Post a Comment

Popular posts from this blog

from: can't read /var/mail/ in Python scripts

Fix "Set scan parameters failed: Input/output error" on Ubuntu 16.04