omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    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) ?

    Pythonista
    aiohttp stash pip greenlet aiobottle
    3
    7
    7957
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Brun0oO
      Brun0oO last edited by Brun0oO

      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

      1 Reply Last reply Reply Quote 0
      • ywangd
        ywangd last edited by

        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.

        1 Reply Last reply Reply Quote 1
        • ccc
          ccc last edited by ccc

          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.

          1 Reply Last reply Reply Quote 0
          • Brun0oO
            Brun0oO last edited by

            Thanks a lot! I´ll give it a try...

            Brun0oO

            1 Reply Last reply Reply Quote 0
            • Brun0oO
              Brun0oO last edited by 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

              1 Reply Last reply Reply Quote 0
              • ccc
                ccc last edited by

                @Brun0oO Were you able to get websockets working?

                1 Reply Last reply Reply Quote 0
                • Brun0oO
                  Brun0oO last edited by Brun0oO

                  @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-aiohttp

                  Brun0oO

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post
                  Powered by NodeBB Forums | Contributors