pkgx: youtube-dl not executing
I got the below error when running trying youtube-dl -h
in addition to just youtube-dl
. I think this is an issue when you try to set PYTHONHOME
& PYTHONPATH
when they are not needed, or with the virtual environment config.
sanch@Sanchits-MBP ~ % youtube-dl
installed: ~/.tea/gnu.org/bash/v5.1.16
installed: ~/.tea/youtube-dl.org/v2021.12.17
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Python path configuration:
PYTHONHOME = (not set)
PYTHONPATH = (not set)
program name = 'python'
isolated = 0
environment = 1
user site = 1
safe_path = 0
import site = 1
is in build tree = 0
stdlib dir = '/opt/python.org/v3.11.0/lib/python3.11'
sys._base_executable = '/Users/sanch/.tea/python.org/v3/bin/python3.11'
sys.base_prefix = '/opt/python.org/v3.11.0'
sys.base_exec_prefix = '/opt/python.org/v3.11.0'
sys.platlibdir = 'lib'
sys.executable = '/Users/sanch/.tea/youtube-dl.org/v2021.12.17/libexec/bin/python'
sys.prefix = '/opt/python.org/v3.11.0'
sys.exec_prefix = '/opt/python.org/v3.11.0'
sys.path = [
'/opt/python.org/v3.11.0/lib/python311.zip',
'/opt/python.org/v3.11.0/lib/python3.11',
'/opt/python.org/v3.11.0/lib/python3.11/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 0x00000001f39cba80 (most recent call first):
<no Python frame>
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 15 (12 by maintainers)
Took some digging but I figured it out. Thanks to these repro instructions:
The issue is that these lines in
python-venv.sh
assume the presence of the TEA_PREFIX environment variable, which apparently does not exist in certain clean installs. Not sure if this assumption is incorrect or if this isn’t getting passed to subcommands within thetea
command environment.https://github.com/teaxyz/pantry.core/blob/55f39f4bff4688fb3ed78e976372adb81cec730e/scripts/brewkit/python-venv.sh#L40-L45
In case I’m not clear, I’m very eager to figure out the issue. I’m pondering it. Any more info you got will help.