Trying to understand how import works in python - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Trying to understand how import works in python (/thread-10877.html) |
Trying to understand how import works in python - patrick99e99 - Jun-11-2018 I am using a python application which requires SimpleWebsocketServer.. I have done: Quote:python3 -m pip install git+https://github.com/ecdsa/simple-websocket-server.git But when I run the app, it fails from Import Error: https://github.com/fyookball/electrum/blob/master/lib/websockets.py#L32 ... When I go into the python3 console, I can do: Quote:Python 3.6.2 (v3.6.2:5fd33b5926, Jul 16 2017, 20:11:06) So it looks like it is there.......... But if I try to do exactly what the app is doing, I have the same error: Quote:>>> from SimpleWebSocketServer import WebSocket, SimpleSSLWebSocketServer Can anyone help with what I am doing wrong? Thanks! RE: Trying to understand how import works in python - snippsat - Jun-11-2018 This is a example of how websocket work. It's not the meaning that you should import,should run the server from command line. λ python SimpleExampleServer.py --example echoNow is the server running,open websocket.html. There is a connect button. Then send and get a response.
RE: Trying to understand how import works in python - patrick99e99 - Jun-11-2018 Thanks but that's not at all related to the question I asked.... RE: Trying to understand how import works in python - patrick99e99 - Jun-12-2018 Nevermind, I found that the problem was the code... Using the parent repo instead of the fork I was using resolved the issue.. this thread can be deleted. |