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

Windows executable has inconsistent Python version response and inability to update depending on current directory #24973

Closed
michealespinola opened this issue Apr 24, 2020 · 3 comments

Comments

@michealespinola
Copy link

@michealespinola michealespinola commented Apr 24, 2020

Checklist

  • I'm reporting a broken site support issue
  • I've verified that I'm running youtube-dl version 2020.03.24
  • I've checked that all provided URLs are alive and playable in a browser
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar bug reports including closed ones
  • I've read bugs section in FAQ

Verbose log

C:\Scripts>youtube-dl.exe --verbose --update
[debug] System config: []
[debug] User config: ['--verbose', '--sub-lang', 'en,EN,en-gb,en-GB,EN-GB,en-ca,en-CA,EN-CA,en-ie,en-IE,EN-IE,en-us,en-US,EN-US,eng,ENG,english,English,ENGLISH,subtitles', '--write-sub', '--write-auto-sub', '--write-thumbnail', '--write-all-thumbnails', '--write-description', '--write-info-json', '--add-metadata', '--xattrs', '--external-downloader', 'aria2c', '--external-downloader-args', '-c -j 16 -s 16 -x 16 -k 5M --file-allocation=none', '--no-playlist', '--netrc', '--cookies', 'C:/Users/USER/common-info/cookies.txt', '--no-check-certificate', '--user-agent', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', '--abort-on-unavailable-fragment', '--socket-timeout', '30', '--retries', '999', '--hls-prefer-native', '--ffmpeg-location', 'C:/Program Files/ffmpeg/bin', '--merge-output-format', 'mkv', '--cache-dir', 'C:/Users/USER/AppData/Roaming/youtube-dl/cache', '--restrict-filenames', '--no-mtime', '--output', 'D:/Downloads/youtube-dl/%(extractor)s/%(title)s [%(resolution)s] [%(id)s].%(ext)s', '--download-archive', 'C:/Users/USER/AppData/Roaming/youtube-dl/download-archive.txt']
[debug] Custom config: []
[debug] Command-line args: ['--verbose', '--update']
[debug] Encodings: locale cp1252, fs utf-8, out utf-8, pref cp1252
[debug] youtube-dl version 2020.03.24
[debug] Python version 3.8.2 (CPython) - Windows-10-10.0.18362-SP0
[debug] exe versions: ffmpeg N-94066-g18dab6175b, ffprobe N-94066-g18dab6175b, phantomjs 2.1.1, rtmpdump 2.4
[debug] Proxy map: {}
It looks like you installed youtube-dl with a package manager, pip, setup.py or a tarball. Please use that to update.

Description

The above example log demonstrates two inconsistencies while running the youtube-dl.exe Windows executable via PATH environment variable execution instead of from the directory that youtube-dl.exe resides. In this example, its located in C:\bin but I am executing it from C:\Scripts:

  1. The logged Python version is not accurate if Python is installed while NOT running youtube-dl.exe from its directory and instead relying on PATH environment variable execution. The example reflects that I have Python 3.8.2 installed on my computer, but youtube-dl.exe should be showing the embedded version of 3.4.4 - which is correctly shown if youtube-dl.exe is run from the directory it actually resides in.
  2. Same scenario: youtube-dl.exe will not update while NOT running youtube-dl.exe from its directory and instead relying on PATH environment variable execution. If run from its directory it works as expected/normal.

To summarize: Both above-described situations will work normally/properly if youtube-dl.exe is run from its directory. The problem is when run via PATH environment variable execution. Downloading and other functions otherwise work fine via PATH environment variable execution.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Apr 24, 2020

  1. Wrong.
  2. Wrong.
C:\Scripts>where youtube-dl.exe
C:\Bin\youtube-dl.exe

C:\Scripts>python --version
Python 2.7.16

C:\Scripts>youtube-dl.exe --verbose --update
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--verbose', '--update']
[debug] Encodings: locale cp1251, fs mbcs, out cp866, pref cp1251
[debug] youtube-dl version 2020.03.24
[debug] Python version 3.4.4 (CPython) - Windows-10-10.0.18362
[debug] exe versions: none
[debug] Proxy map: {}
youtube-dl is up-to-date (2020.03.24)
@dstftw dstftw closed this Apr 24, 2020
@dstftw
Copy link
Collaborator

@dstftw dstftw commented Apr 24, 2020

Your situation is youtube-dl installed via pip that is earlier in PATH than youtube-dl.exe so that pip version is always executed. Apart from sutiation when running from C:/bin - in this case exe version is executed.

@dstftw dstftw added the invalid label Apr 24, 2020
@michealespinola
Copy link
Author

@michealespinola michealespinola commented Apr 24, 2020

You're absolutely right, and I apologize for wasting your time.

I have no recollection of installing it with pip, but there is a 95 kb youtube-dl.exe in my Python/Scripts directory. So clearly at some point, I did.

Thank you very much for pointing out what I had done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.