kewlbear / YoutubeDL

An iOS app using youtube-dl Python module with PythonKit Swift package
MIT License
210 stars 36 forks source link

Requirements for the code to run elsewhere? (files, packages, libraries, etc.) #4

Closed jayc809 closed 3 years ago

jayc809 commented 3 years ago

Hi,

I want to download a Youtube video (given the video id), save it in the app internally, and play/access it. I tried copying the files over and adding the package dependencies (e.g. ffmpeg, python, YoutubeDL), but when I ran the app and tried downloading a video, I get this error:

Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Python path configuration:
  PYTHONHOME = (not set)
  PYTHONPATH = (not set)
  program name = 'python3'
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  sys._base_executable = '/private/var/containers/Bundle/Application/214045C5-B223-4526-BFE5-39A9CB268D35/yt test.app/yt test'
  sys.base_prefix = '/Users/runner/work/Python-iOS/Python-iOS/kivy-ios/dist/root/python3'
  sys.base_exec_prefix = '/Users/runner/work/Python-iOS/Python-iOS/kivy-ios/dist/root/python3'
  sys.executable = '/private/var/containers/Bundle/Application/214045C5-B223-4526-BFE5-39A9CB268D35/yt test.app/yt test'
  sys.prefix = '/Users/runner/work/Python-iOS/Python-iOS/kivy-ios/dist/root/python3'
  sys.exec_prefix = '/Users/runner/work/Python-iOS/Python-iOS/kivy-ios/dist/root/python3'
  sys.path = [
    '/Users/runner/work/Python-iOS/Python-iOS/kivy-ios/dist/root/python3/lib/python38.zip',
    '/Users/runner/work/Python-iOS/Python-iOS/kivy-ios/dist/root/python3/lib/python3.8',
    '/Users/runner/work/Python-iOS/Python-iOS/kivy-ios/dist/root/python3/lib/lib-dynload',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

Current thread 0x000000016f587000 (most recent call first):
<no Python frame>

What else do I need to do for the DownloadViewController class to work?

kewlbear commented 3 years ago

Maybe you forgot PythonSupport.initialize()?