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

Working with pyatv on iOS with PythonKit and Python.framework #2481

Open
Sorrow91 opened this issue Aug 20, 2024 · 0 comments
Open

Working with pyatv on iOS with PythonKit and Python.framework #2481

Sorrow91 opened this issue Aug 20, 2024 · 0 comments
Labels

Comments

@Sorrow91
Copy link

Sorrow91 commented Aug 20, 2024

Describe the bug

I have problems to get the pyatv working under iOS (arm64).

Error log

PythonKit/Python.swift:707: Fatal error: 'try!' expression unexpectedly raised an error: Python exception: dlopen(/Users/kevin/Library/Developer/CoreSimulator/Devices/5D10560B-E4C2-4367-A773-1E8EB170E278/data/Containers/Bundle/Application/CA01303A-7E6E-45A5-81FA-21834A8936AC/pythontest.app/PythonScripts/cryptography/hazmat/bindings/_rust.abi3.so, 0x0002): tried: '/Users/kevin/Library/Developer/Xcode/DerivedData/pythontest-burgqkwtysmeqqddacdjyferjzai/Build/Products/Debug-iphonesimulator/_rust.abi3.so' (no such file), '/Library/Developer/CoreSimulator/Volumes/iOS_21F79/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.5.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection/_rust.abi3.so' (no such file), '/Library/Developer/CoreSimulator/Volumes/iOS_21F79/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.5.simruntime/Contents/Resources/RuntimeRoot/Users/kevin/Library/Developer/CoreSimulator/Devices/5D10560B-E4C2-4367-A773-1E8EB170E278/data/Containers/Bundle/Application/CA01303A-7E6E-45A5-81FA-21834A8936AC/pythontest.app/PythonScripts/cryptography/hazmat/bindings/_rust.abi3.so' (no such file), '/Users/kevin/Library/Developer/CoreSimulator/Devices/5D10560B-E4C2-4367-A773-1E8EB170E278/data/Containers/Bundle/Application/CA01303A-7E6E-45A5-81FA-21834A8936AC/pythontest.app/PythonScripts/cryptography/hazmat/bindings/_rust.abi3.so' (mach-o file (/Users/kevin/Library/Developer/CoreSimulator/Devices/5D10560B-E4C2-4367-A773-1E8EB170E278/data/Containers/Bundle/Application/CA01303A-7E6E-45A5-81FA-21834A8936AC/pythontest.app/PythonScripts/cryptography/hazmat/bindings/_rust.abi3.so), but incompatible platform (have 'macOS', need 'iOS-sim'))
Traceback:
  File "/Users/kevin/Library/Developer/CoreSimulator/Devices/5D10560B-E4C2-4367-A773-1E8EB170E278/data/Containers/Bundle/Application/CA01303A-7E6E-45A5-81FA-21834A8936AC/pythontest.app/PythonScripts/pyatvScript.py", line 2, in <module>
    from pyatv import scan
  File "/Users/kevin/Library/Developer/CoreSimulator/Devices/5D10560B-E4C2-4367-A773-1E8EB170E278/data/Containers/Bundle/Application/CA01303A-7E6E-45A5-81FA-21834A8936AC/pythontest.app/PythonScripts/pyatv/__init__.py", line 26, in <module>
    from pyatv.protocols import PROTOCOLS
  File "/Users/kevin/Library/Developer/CoreSimulator/Devices/5D10560B-E4C2-4367-A773-1E8EB170E278/data/Containers/Bundle/Application/CA01303A-7E6E-45A5-81FA-21834A8936AC/pythontest.app/PythonScripts/pyatv/protocols/__init__.py", line 10, in <module>
    from pyatv.protocols import airplay as airplay_proto
  File "/Users/kevin/Library/Developer/CoreSimulator/Devices/5D10560B-E4C2-4367-A773-1E8EB170E278/data/Containers/Bundle/Application/CA01303A-7E6E-45A5-81FA-21834A8936AC/pythontest.app/PythonScripts/pyatv/protocols/airplay/__init__.py", line 28, in <module>
    from pyatv.protocols import mrp
  File

How to reproduce the bug?

This is my function:

from pyatv import scan

async def find_devices():
    loop = asyncio.get_event_loop()
    devices = await scan(loop, protocol=Protocol.MRP)
    for device in devices:
        print(f"Name: {device.name}, Address: {device.address}")

asyncio.run(find_devices())

What is expected behavior?

Working on the iOS with PythonKit and Python.framework

Operating System

iOS

Python

3.12

pyatv

0.15.0

Device

Apple iPhone 15 iOS 17.5

Additional context

Is there a workaround?

@Sorrow91 Sorrow91 added the bug label Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant