This is a very new (two days) Win10 install on a clean disk.
And a new install of the latest Python release.
And an install of Python 2.7 because someone suggested that might help but it didn't.
I use youtube-dl from the command prompt - from Powershell - and it won't run but instead I get this error message:
PS C:\Windows\system32> youtube-dl
Fatal Python error: Py_Initialize: unable to load the file system codec
ImportError: No module named 'encodings'
Can anyone help with that please?
Quote:Python 2.7 because someone suggested that might help
stay away from python 2.7 on all new development, always use latest release.
Follow this
Python 3.6/3.7 and pip installation under Windows
Then is shall work like this,i test isolated(virtual environment
venv) as already have youtube-dl.
(forum_env) E:\div_code\forum_env
# Test pip
λ pip -V
pip 19.0.3 from e:\div_code\forum_env\lib\site-packages\pip (python 3.7)
(forum_env) E:\div_code\forum_env
# Install youtube-dl
λ pip install --upgrade youtube-dl
Collecting youtube-dl
Downloading ...
Successfully installed youtube-dl-2019.9.28
(forum_env) E:\div_code\forum_env
# Test that it work,example to MP3 highest quality
λ youtube-dl --extract-audio --audio-format mp3 --audio-quality 0 "https://www.youtube.com/watch?v=HW_EmCGc6DI&list=RDHW_EmCGc6DI&start_radio=1"
[download] Downloading playlist: Mix - Halsey - Nightmare in the Live Lounge
[youtube:playlist] playlist Mix - Halsey - Nightmare in the Live Lounge: Collected 281 video ids (downloading 281 of them)
.....
[download] Destination: Halsey - Nightmare in the Live Lounge-HW_EmCGc6DI.webm
[download] 100% of 3.91MiB in 00:01
[ffmpeg] Destination: Halsey - Nightmare in the Live Lounge-HW_EmCGc6DI.mp3
Deleting original file Halsey - Nightmare in the Live Lounge-HW_EmCGc6DI.webm (pass -k to keep)
Thank you very much for that. I followed it to the letter and apparently I've got a viable python installation now.
I did get an error at the end of the test download:
ERROR: ffprobe/avprobe and ffmpeg/avconv not found. Please install one.
Can I do that within the powershell python thing?
Thank you very much for that help. It's great. :)
(Sep-30-2019, 09:16 PM)abrogard Wrote: [ -> ]I did get an error at the end of the test download:
ERROR: ffprobe/avprobe and ffmpeg/avconv not found. Please install one.
Download
Zeranoe FFmpeg Builds.
The simplest can be if you unsure of adding to Windows path.
Put to together with
youtube-dl.exe
it's in eg
python37\Scripts
folder.
Then look like this in root python/
Scripts
folder:
youtube-dl.exe
ffprobe.exe
ffplay.exe
ffmpeg.exe
Quote:Can I do that within the powershell python thing?
Yes you can do same commands in powershell,i use cmder because it look better and all Linux commands that i am used to work.
Like
ls
which like better than
dir
,both work it just that cmder add more stuff.
Here Script folder of virtual environment.
![[Image: Z9Tht6.png]](https://imagizer.imageshack.com/v2/xq90/923/Z9Tht6.png)