Skip to content
This repository was archived by the owner on Jan 7, 2023. It is now read-only.
This repository was archived by the owner on Jan 7, 2023. It is now read-only.

Running with python, help needed #123

@DanBmh

Description

@DanBmh

I could install this project with python bindings, and run the example pub/sub scripts, but pub and sub are not exchanging messages.

The output of pub:

/dps-for-iot/py_scripts# PYTHONPATH=../build/dist/py python simple_pub.py 
Publisher is listening on [::]:57575
Pub UUID f4d1c799-8bcb-2574-6155-f11c9e9f8074(1)
Pub UUID f4d1c799-8bcb-2574-6155-f11c9e9f8074(2)
Traceback (most recent call last):
  File "simple_pub.py", line 185, in <module>
    dps.destroy_publication(pub)
TypeError: destroy_publication expected 2 arguments, got 1

The output of sub:

/dps-for-iot/py_scripts# PYTHONPATH=../build/dist/py python simple_sub.py 
Subscriber is listening on [::]:48070

I did start the subscriber before the publisher and I think i'm missing some network options.
What do I need to do to get this work?




And another question, I would like to use it with python3 instead of python2, but in this case i get following error:

Traceback (most recent call last):
  File "simple_sub.py", line 2, in <module>
    import dps
  File "/dps-for-iot/build/dist/py/dps.py", line 24, in <module>
    _dps = swig_import_helper()
  File "/dps-for-iot/build/dist/py/dps.py", line 23, in swig_import_helper
    return importlib.import_module('_dps')
  File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ImportError: /dps-for-iot/build/dist/py/_dps.so: undefined symbol: PyInstance_Type

Is python3 supported or do you plan to support it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions