Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
[SOLVED] How to install greenlet (for gevent-websocket) ?
-
Hello,
I saw this post http://omz-software.com/pythonista/docs/ios/bottle/async.html and I would like to try websocket communications between my iOS device and my desktop.
Using Stash and pip, I managed to install gevent. The gevent-websocket installation complained about greenlet installation. I tried to install it using pip install greenlet but I got a message "Error: Cannot locate packages. Manual installation required.".
How this can be done ?Thanks for your help...
Brun0oO -
It cannot be done.
greenlet
does not work in Pythonista.greenlet
is a pure C extension. It does not have any Python modules to be installed. That is what caused the error. C extension installation generally requires compiling C code which is impossible in Pythonista. -
Asyncio is built into Python 3.5 so, in theory, you could add https://github.com/Lupino/aiobottle to Pythonista 3. It is pure Python and requires https://github.com/KeepSafe/aiohttp which is also pure Python. aiohttp alone would be enough to give you Web Sockets but aiobottle would be required to get async bottle. Please let us know if you make progress on this.
-
Thanks a lot! I´ll give it a try...
Brun0oO
-
I managed to install aiobottle which requires aiohttp, multidict and chardet (I used pip install <package> under stash to install all these packages).
And this simple server (running on my ios device) seems to work from my desktop web browser:
from aiobottle import AsyncBottle import aiohttp app = AsyncBottle() @app.get('/') def root(): return 'hello word!' def main(host='0.0.0.0', port=8080): from bottle import run run(app, host = host, port = port, server = 'aiobottle:AsyncServer') if __name__ == '__main__': main()
Now, I'm trying to understand how websockets should work with aiobottle.
Thanks again for your help!
Brun0oO -
@Brun0oO Were you able to get websockets working?
-
@ccc not really ;o)
I prefer to open a new topic :
https://forum.omz-software.com/topic/3404/is-it-possible-to-manage-websockets-with-aiosync-and-aiohttpBrun0oO