sigalor / whatsapp-web-reveng

Reverse engineering WhatsApp Web.
MIT License
6.1k stars 802 forks source link

No module named 'SimpleWebSocketServer' #184

Open GlauberF opened 5 years ago

GlauberF commented 5 years ago

I installed SimpleWebSocketServe, through the pip as the repository shows (https://github.com/dpallot/simple-websocket-server), but when I run npm start, I get the error

Captura de Tela_selecionar área_20190408083405

sthales commented 5 years ago

Try running pip install -r requirements.txt

GlauberF commented 5 years ago

I already did this procedure, but I tried again

Captura de Tela_selecionar área_20190408181832

sigalor commented 5 years ago

Which output do you get from python --version and pip --version? It's possible that your default Python installation has version 2.7, but pip actually modifies the packages for Python 3.

Maybe python2.7 -m pip install -r requirements.txt helps in this case, but I have not tested that myself yet.

It's quite unfortunate that the code in this repository still depends on Python 2.7, but for now we'll have to deal with it.

GlauberF commented 5 years ago

Captura de Tela_selecionar área_20190412081513

sigalor commented 5 years ago

Ahh, there you have it! Your system is configured to only use Python 3.

Try executing python2.7 -m pip install -r requirements.txt then (if you haven't done so already), then change the two occurrences of python ./backend/whatsapp_web_backend.py in the root package.json to python2.7 ./backend/whatsapp_web_backend.py.

0xFEEDC0DE64 commented 5 years ago

Any ideas for my case?

[feedc0de@flucky-server whatsapp-web-reveng]$ alias python=python2
[feedc0de@flucky-server whatsapp-web-reveng]$ alias pip=pip2
[feedc0de@flucky-server whatsapp-web-reveng]$ python --version
Python 2.7.16
[feedc0de@flucky-server whatsapp-web-reveng]$ npm start

> whatsapp-web-reveng@1.0.0 start /home/feedc0de/whatsapp-web-reveng
> npm run dev

> whatsapp-web-reveng@1.0.0 dev /home/feedc0de/whatsapp-web-reveng
> concurrently --kill-others "./node_modules/.bin/nodemon index.js -i client -e js" "./node_modules/.bin/nodemon --exec python ./backend/whatsapp_web_backend.py -i client -e py" "sass --watch client/css/main.scss:client/css/main.css"

[2] Sass is watching for changes. Press Ctrl-C to stop.
[2] 
[1] [nodemon] 1.18.10
[1] [nodemon] to restart at any time, enter `rs`
[1] [nodemon] watching: *.*
[1] [nodemon] starting `python ./backend/whatsapp_web_backend.py`
[1] Traceback (most recent call last):
[1]   File "./backend/whatsapp_web_backend.py", line 15, in <module>
[1]     from SimpleWebSocketServer import SimpleWebSocketServer, WebSocket;
[1] ModuleNotFoundError: No module named 'SimpleWebSocketServer'
[1] [nodemon] app crashed - waiting for file changes before starting...
[0] [nodemon] 1.18.10
[0] [nodemon] to restart at any time, enter `rs`
[0] [nodemon] watching: *.*
[0] [nodemon] starting `node index.js`
[0] whatsapp-web-reveng API server listening on port 2019
[0] whatsapp-web-reveng HTTP server listening on port 2018
^C
[feedc0de@flucky-server whatsapp-web-reveng]$ sudo pip2 install -r requirements.txt
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Collecting git+https://github.com/dpallot/simple-websocket-server.git (from -r requirements.txt (line 2))
  Cloning https://github.com/dpallot/simple-websocket-server.git to /tmp/pip-req-build-kC8SZc
Requirement already satisfied (use --upgrade to upgrade): SimpleWebSocketServer==0.1.1 from git+https://github.com/dpallot/simple-websocket-server.git in /usr/lib/python2.7/site-packages (from -r requirements.txt (line 2))
Requirement already satisfied: websocket-client in /usr/lib/python2.7/site-packages (from -r requirements.txt (line 1)) (0.56.0)
Requirement already satisfied: curve25519-donna in /usr/lib/python2.7/site-packages (from -r requirements.txt (line 3)) (1.3)
Requirement already satisfied: pycrypto in /usr/lib/python2.7/site-packages (from -r requirements.txt (line 4)) (2.6.1)
Requirement already satisfied: pyqrcode in /usr/lib/python2.7/site-packages (from -r requirements.txt (line 5)) (1.2.1)
Requirement already satisfied: protobuf in /usr/lib/python2.7/site-packages (from -r requirements.txt (line 6)) (3.8.0)
Requirement already satisfied: six in /usr/lib/python2.7/site-packages (from websocket-client->-r requirements.txt (line 1)) (1.12.0)
Requirement already satisfied: setuptools in /usr/lib/python2.7/site-packages (from protobuf->-r requirements.txt (line 6)) (41.0.1)
jadeye commented 3 years ago

I'm having a similar issue:

Traceback (most recent call last):
File "./backend/whatsapp_web_backend.py", line 15, in <module>
from SimpleWebSocketServer import SimpleWebSocketServer, WebSocket;
ModuleNotFoundError: No module named 'SimpleWebSocketServer'
[nodemon] app crashed - waiting for file changes before starting...
Ubuntu 18.04
Python 3.6.9
pip 20.3.1 from /home/user/.local/lib/python3.6/site-packages/pip (python 3.6)

I am writing after trying to resolve this myself in vain. Any ideas?