question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Implementing twisted and autobahn related recipes

See original GitHub issue

Hi,

I currently try (from time to time) to implement recipes for installing autobahn and twisted. Basic implementation is already done here https://github.com/rnixx/kivy-ios/tree/twisted_recipe/recipes

Package dependencies looks like:

autobahn==0.16.0
    * six
    * txaio
cffi==1.8.3
    * pycparser
cryptography==1.5.2
    * cffi
    * enum34
    * idna
    * pyasn1
    * six
enum34==1.1.6
    * NONE
idna==2.1
    * NONE
ipaddress==1.0.17
    * NONE
pyasn1==0.1.9
    * ipaddress
pycparser==2.14
    * NONE
pyOpenSSL==16.1.0
    * cryptography
six==1.10.0
    * NONE
Twisted==16.4.1
    * zope.interface
txaio==2.5.1
    * six
zope.interface==4.3.2
    * setuptools

The recipes for these packages are basically implemented and define the dependencies properly.

The pure python package related recipes install successfully.

I also had a look how python-for-android handles twisted installation and then I came along install_in_hostpython flag on it’s recipes, which is set for cffi, pycparser and twisted among some other unrelated recipes.

pycryptography tries to download and build it’s dependencies inside it’s build folder if dependencies are missing, thus I tried to install cffi and pycparser in hostpython as well to avoid this. For pycparser this works, while cffi causes troubles.

The target builds of cffi work (I deployed to an iPad, imported cffi and instanciated a cffi.api.FFI() object).

The installation in hostpython installs, import works as well, but instanciating cffi.api.FFI() fails:

myhost:kivy-ios user$ ./dist/hostpython/bin/python
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Python 2.7.1 (r271:86832, Nov  4 2016, 10:41:44)
[GCC 4.2.1 Compatible Apple LLVM 7.3.0 (clang-703.0.31)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cffi
>>> cffi.api.FFI()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/.../kivy-ios/dist/hostpython/lib/python2.7/site-packages/cffi/api.py", line 56, in __init__
    import _cffi_backend as backend
ImportError: dynamic module does not define init function (init_cffi_backend)

You can find the code here https://github.com/rnixx/kivy-ios/blob/twisted_recipe/recipes/cffi/__init__.py

Any advice and or help how to fix this is really appreciated.

Thanks

<bountysource-plugin> --- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/38961088-implementing-twisted-and-autobahn-related-recipes?utm_campaign=plugin&utm_content=tracker%2F9081&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F9081&utm_medium=issues&utm_source=github). </bountysource-plugin>

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
rodjuncommented, Feb 8, 2017

For anyone following the guide that @keavin7 quoted, some notes to actually get it working:

That directory thing is not necessary at all, don’t do it.

You actually need to move 4 dependencies to the place where main.py is located, they are:

  • constantly
  • incremental
  • twisted
  • zope

Also make sure that you create a init.py file inside the zope folder or you will get an import error (“can’t find zope.interfaces”).

like others mentioned, SSL does not work so don’t use this for important stuff, my use case is just passing some data from my computer to other computers or mobile devices, it’s also nothing sensitive so i have no problems with the lack of SSL.

0reactions
Zen-CODEcommented, Jun 27, 2020

PR’s to add these welcome. Closing the ticket due to inactivity…

Read more comments on GitHub >

github_iconTop Results From Across the Web

WebSocket Programming - Autobahn|Python - Read the Docs
The first thing to note is that you derive your protocol class from a base class provided by Autobahn. Depending on whether you...
Read more >
Getting started with Crossbar.io
Crossbar.io is a WAMP router with advanced features implemented in the Python language. ... 1from autobahn.twisted.component import Component, run 2from ...
Read more >
Realtime Streaming using Autobahn Websockets - SlideShare
Autobahn • A WebSocket framework built on Twisted • scales to 10s of thousands of connections ... Protocols and Transports Protocol Internal State ......
Read more >
Transports and Protocols — Python 3.11.1 documentation
A different way of saying the same thing: a transport is an abstraction for a socket (or similar I/O endpoint) while a protocol...
Read more >
Websocket Autobahn Python client: how to connect to server ...
A websocket client (using Autobahn/Python and Twisted) needs to connect to a ... then you should see a log message similar to 2019-05-03...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found