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

ImportError: cannot import name 'get_tunneld_devices' from 'pymobiledevice3.tunneld' #178

Open
ernietedeschi opened this issue Jan 3, 2025 · 6 comments

Comments

@ernietedeschi
Copy link

ernietedeschi commented Jan 3, 2025

Installing on Windows 11 / Python 3.10.6. Installs without any issues. But when I move to test the installation with SideJITServer --version (yes, still in venv), I get the following error:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "c:\Users\ernie\SideJITServer\venv\Scripts\SideJITServer.exe\__main__.py", line 4, in <module>
  File "C:\Users\ernie\SideJITServer\venv\Lib\site-packages\SideJITServer\__init__.py", line 22, in <module>
    from pymobiledevice3.tunneld import get_tunneld_devices, TUNNELD_DEFAULT_ADDRESS, TunneldRunner
ImportError: cannot import name 'get_tunneld_devices' from 'pymobiledevice3.tunneld' (C:\Users\ernie\SideJITServer\venv\Lib\site-packages\pymobiledevice3\tunneld\__init__.py)

Device is unlocked and physically connected, iTunes/iCloud are running, everything that allowed me to successfully install AltStore originally is in place here.

@JojoZockt
Copy link

same

@pitoregia
Copy link

pymobiledevice3 package got an update, and that's probably what's causing the import error you're seeing. It's an easy fix, though.

You'll just need to tweak the import lines. Change this:

from pymobiledevice3.tunneld import get_tunneld_devices, TUNNELD_DEFAULT_ADDRESS, TunneldRunner

to this:

from pymobiledevice3.tunneld.api import get_tunneld_devices, TUNNELD_DEFAULT_ADDRESS
from pymobiledevice3.tunneld.server import TunneldRunner

If this turns out to be a prolonged problem, I'll issue a pull request to help out.

@ernietedeschi
Copy link
Author

ernietedeschi commented Jan 3, 2025

This worked!

For posterity: the lines are in the __init__.py file in the ./SideJITServer/SideJITServer folder.

@JojoZockt
Copy link

still not working for me sadly

@SomethingYee
Copy link

pymobiledevice3 package got an update, and that's probably what's causing the import error you're seeing. It's an easy fix, though.

You'll just need to tweak the import lines. Change this:

from pymobiledevice3.tunneld import get_tunneld_devices, TUNNELD_DEFAULT_ADDRESS, TunneldRunner

to this:

from pymobiledevice3.tunneld.api import get_tunneld_devices, TUNNELD_DEFAULT_ADDRESS
from pymobiledevice3.tunneld.server import TunneldRunner

If this turns out to be a prolonged problem, I'll issue a pull request to help out.

is there a tutorial on how to do this? Im new to this and im having the same issue and I dont know how to do that,.

@HarshLR-cpu
Copy link

HarshLR-cpu commented Jan 15, 2025

On the latest version I'm still getting a related error, this is the error log being shown

ERROR:pymobiledevice3.tunneld.server:got exception from start-tunnel-task-usbmux-00008132-001218383C69001C-USB: Traceback (most recent call last):
  File "C:\Users\user\Downloads\SideJITServer-main\venv\Lib\site-packages\pymobiledevice3\tunneld\server.py", line 197, in start_tunnel_task
    async with start_tunnel(protocol_handler, protocol=protocol) as tun:
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.2288.0_x64__qbz5n2kfra8p0\Lib\contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\Downloads\SideJITServer-main\venv\Lib\site-packages\pymobiledevice3\remote\tunnel_service.py", line 1039, in start_tunnel
    async with protocol_handler.start_tcp_tunnel() as service:
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.2288.0_x64__qbz5n2kfra8p0\Lib\contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\Downloads\SideJITServer-main\venv\Lib\site-packages\pymobiledevice3\remote\tunnel_service.py", line 947, in start_tcp_tunnel
    tunnel.start_tunnel(handshake_response['clientParameters']['address'],
  File "C:\Users\user\Downloads\SideJITServer-main\venv\Lib\site-packages\pymobiledevice3\remote\tunnel_service.py", line 299, in start_tunnel
    super().start_tunnel(address, mtu)
  File "C:\Users\user\Downloads\SideJITServer-main\venv\Lib\site-packages\pymobiledevice3\remote\tunnel_service.py", line 180, in start_tunnel
    self.tun = TunTapDevice()

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

5 participants