facebook / idb

idb is a flexible command line interface for automating iOS simulators and devices
https://fbidb.io
MIT License
4.51k stars 432 forks source link

ImportError: cannot import name 'PingAcknowledged' from 'h2.events' #623

Open justinhandley opened 4 years ago

justinhandley commented 4 years ago

Description

I followed the instructions to install idb on a mac. When I try to run IDB (any command) I get this.

Traceback (most recent call last): File "/Users/justinhandley/.pyenv/versions/3.8.5/bin/idb", line 5, in from idb.cli.main import main File "/Users/justinhandley/.pyenv/versions/3.8.5/lib/python3.8/site-packages/idb/cli/init.py", line 23, in from idb.grpc.client import IdbClient as IdbClientGrpc File "/Users/justinhandley/.pyenv/versions/3.8.5/lib/python3.8/site-packages/idb/grpc/client.py", line 30, in from grpclib.client import Channel File "/Users/justinhandley/.local/lib/python3.8/site-packages/grpclib/client.py", line 26, in from .protocol import H2Protocol, AbstractHandler, Stream as _Stream, Peer File "/Users/justinhandley/.local/lib/python3.8/site-packages/grpclib/protocol.py", line 22, in from h2.events import StreamReset, PriorityUpdated, PingAcknowledged ImportError: cannot import name 'PingAcknowledged' from 'h2.events' (/Users/justinhandley/.local/lib/python3.8/site-packages/h2/events.py)

Reproduction

I'm not sure. I'm on Mac 10.15.6.

Additional Information

I tried several workarounds I came across online, but couldn't find this specific issue.

skatea09 commented 4 years ago

Probably not the greatest solution but i was able to get it working by

pip uninstall h2 And then running pip install h2===3.2.0

The problem for me was that the h2 version was 4.0 and that version updated the naming of PingAcknowledge

oferRounds commented 4 years ago

@justinhandley did you find any solution? @skatea09’s solution did not work for me

justinhandley commented 4 years ago

Actually @skatea09's solution completely worked for me. So, not sure...

oferRounds commented 4 years ago

Ok, thank you!

Sadbot commented 4 years ago

solution by @skatea09 worked for me, thanks!

mkhvatov commented 3 years ago

Probably not the greatest solution but i was able to get it working by

pip uninstall h2 And then running pip install h2===3.2.0

The problem for me was that the h2 version was 4.0 and that version updated the naming of PingAcknowledge

It works! Thank you!

honglei commented 3 years ago

use grpclib==0.4.1, see https://github.com/vmagamedov/grpclib/issues/119