Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Required version of python and libraries? #41

Open
andreaswatch opened this issue Dec 31, 2020 · 2 comments
Open

Required version of python and libraries? #41

andreaswatch opened this issue Dec 31, 2020 · 2 comments

Comments

@andreaswatch
Copy link

andreaswatch commented Dec 31, 2020

First of all I would like to thank you for your effort in porting peerjs to python, this is a very interesting library!

Running the code below gives me:
createDataChannel() got an unexpected keyword argument 'ordered' File "/home/pi/automations/OpenCv/lib/python3.7/site-packages/peerjs/negotiator.py", line 63, in startConnection dataConnection.label, ordered=reliable)

options = PeerOptions(
    host = HOST,
    port = PORT,
    path = PATH,
    secure = True
)

peer = Peer("myId", options)
@peer.on(PeerEventType.Open)
async def on_open(data):
    print("Open: " + data)

async def start():
    global peer
    await peer.start()
    remote = await peer.connect("remoteId")
    while True:#peer.open:
        await asyncio.sleep(3)

if __name__ == "__main__":
    loop = asyncio.get_event_loop()
    loop.run_until_complete(start())
    loop.run_forever()

However, removing the 'ordered' argument, gives me further exceptions, like:
'dict' object has no attribute 'constraints'
(from negotiator.py #209)

So I guess that the problem might be in my python version or the installed library versions...(?)
I installed these requirements in a new venv:
#requirements.txt av~=8.0.0 aiortc>=0.9 websockets>=8.1 aiohttp>=3.6 pyee>=6.0 websockets>=8.1 dataclasses_json>=0.3 coloredlogs>=10.0

python --version Python 3.7.3

Could you please help to come around the problems?

@snroeust
Copy link

snroeust commented Jan 6, 2021

I find this library very interesting and have been looking into it a bit ,when i run your code it connects to my peerjs server.
But when I insert the remote ID of the other client given from the the peerjs server I get the error message:

Traceback (most recent call last):
File "test.py", line 51, in
loop.run_until_complete(start())
File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_co
mplete
return future.result()
File "test.py", line 45, in start
remote = await peer.connect("79b105b3-75c1-4021-b71a-8698b8a3b978")
File "/home/robert/.local/lib/python3.8/site-packages/peerjs/peer.py", line
364, in connect
dataConnection = DataConnection(peer, self, options)
TypeError: init() takes from 1 to 3 positional arguments but 4 were given

Any idea what could be the reason ?

@andreaswatch
Copy link
Author

No, I'm sorry. I am still hoping for an answer to my question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants