question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Build the Windows exe with Python 3.6

See original GitHub issue
  • I’ve verified and I assure that I’m running youtube-dl 2016.07.05

Before submitting an issue make sure you have:

  • At least skimmed through README and most notably FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

Description of your issue, suggested solution and other information

Some Python bugs (#8132, #7951) is fixed upstream and included in new Python versions. However, the 3.4 branch of Python now receives only security fixes. As a result, Windows users have to install the latest Python 2.7 or 3.5 and optionally build their own youtube-dl.exe.

py2exe is dead and gets no new fixes since Oct 2014. Here I suggest to move to another bundling tool.

  1. PyInstaller I got an error when installing PyInstaller - one of its dependencies is broken (erocarrera/pefile#105) Need to install the latest git-master of pefile. After installation everything looks fine (see test results later)
  2. cx_Freeze There are still commits last month but no releases since Dec 2014. Sounds less promising so I didn’t test it.

Testing results for PyInstaller

G:\Projects\youtube-dl>C:\Users\yen\AppData\Local\Programs\Python\Python35-32\Scripts\pyinstaller.exeScripts\pyinstaller.exe youtube_dl\__main__.py --onefile
G:\Projects\youtube-dl>C:

C:\Users\yen>G:\Projects\youtube-dl\dist\__main__.exe -v test:xuite
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-v', 'test:xuite']
[debug] Encodings: locale cp950, fs mbcs, out cp950, pref cp950
[debug] youtube-dl version 2016.07.05
[debug] Python version 3.5.2 - Windows-7-6.1.7601-SP1
[debug] exe versions: none
[debug] Proxy map: {}
[TestURL] Test URL: http://vlog.xuite.net/play/RGkzc1ZULTM4NjA5MTQuZmx2
[Xuite] RGkzc1ZULTM4NjA5MTQuZmx2: Downloading webpage
[Xuite] flv config: Downloading XML
[debug] Invoking downloader on 'http://5.mms.vlog.xuite.net/video/d90029/RGkzc1ZULTM4NjA5MTQuZmx2?k=83d2bffb6e41c13bef881851cf3433e6&q=mp3'
[download] Destination: 孤單南半球-歐德陽-3860914.mp3
[download] 100% of 3.77MiB in 00:00

C:\Users\yen>G:\Projects\youtube-dl\dist\__main__.exe -v test:youtube
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-v', 'test:youtube']
[debug] Encodings: locale cp950, fs mbcs, out cp950, pref cp950
[debug] youtube-dl version 2016.07.05
[debug] Python version 3.5.2 - Windows-7-6.1.7601-SP1
[debug] exe versions: none
[debug] Proxy map: {}
[TestURL] Test URL: http://www.youtube.com/watch?v=BaW_jenozKc&t=1s&end=9
[youtube] BaW_jenozKc: Downloading webpage
[youtube] BaW_jenozKc: Downloading video info webpage
[youtube] BaW_jenozKc: Extracting video information
[youtube] BaW_jenozKc: Downloading MPD manifest
[debug] Invoking downloader on 'https://r5---sn-5njj-u2xe.googlevideo.com/videoplayback?mt=1467713206&sparams=cnr%2Cdur%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Cratebypass%2Crequiressl%2Csource%2Cupn%2Cexpire&mv=m&ms=au&ip=140.112.230.216&requiressl=yes&mm=31&mn=sn-5njj-u2xe&id=o-AEkgVjFdJPzfmRjB0uKvDsKWLa2XSwYZ4jGFftQ_ja9N&pl=16&itag=22&initcwndbps=6036250&ratebypass=yes&expire=1467735204&fexp=9406174%2C9416126%2C9416891%2C9422596%2C9428398%2C9431012%2C9433096%2C9433223%2C9433946%2C9435526%2C9435876%2C9436965%2C9437066%2C9437553%2C9438327%2C9439652&ipbits=0&dur=9.891&sver=3&mime=video%2Fmp4&key=yt6&signature=2317B697B0D035F741776D0B4EE0E4CB6E773CBD.274C21B2BC22BC647D657CD9DD9FC5312266BF07&upn=3cWCeTQL_SY&source=youtube&cnr=14&lmt=1387961818043059'
[download] Destination: youtube-dl test video ''_ä↭𝕐-BaW_jenozKc.mp4
[download] 100% of 1.53MiB in 00:00

C:\Users\yen>

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:27 (4 by maintainers)

github_iconTop GitHub Comments

20reactions
tylerszabocommented, Mar 14, 2019

I tried using pyinstaller with python 3.7.2 on Windows 10 and it’s working flawlessly.

As easy as installing pyinstaller with:

python.exe -m pip install pyinstaller

Then building the exe with:

pyinstaller.exe youtube_dl\__main__.py --onefile --name youtube-dl

So far I haven’t had any unusual behaviors with the exe but I also don’t know what paces to put it through. I’d encourage people to try it and see what breaks.

3reactions
albertosottilecommented, Mar 26, 2019

If I may, I have been working on resurrecting py2exe and make it compatible with the latest versions of python. If you want, you could give a try at the prebuilt wheels that I just released here: https://github.com/albertosottile/py2exe/releases/tag/v0.9.3.0

Please, let me know if you find any errors when packaging youtube-dl. This is a big project and I am sure it will provide a good benchmark for these new wheels.

Read more comments on GitHub >

github_iconTop Results From Across the Web

pyinstaller - how to build .exe for python 3.5+, 3.6 if possible?
Pyinstaller Works with Python 3.5 and it is working even for packages like tensor-flow, scipy , etc (The packages I worked with)
Read more >
Build Windows executable from Python 3.6 package
Build Windows executable from Python 3.6 package · From a Windows command shell, make “virtualenv” available to the system with · Create a...
Read more >
Python Release Python 3.6.8
There are redistributable zip files containing the Windows builds, making it easy to redistribute Python as part of another software package ...
Read more >
3. Using Python on Windows — Python 3.6.3 documentation
To make Python available, the CPython team has compiled Windows installers (MSI packages) with every release for many years. These installers are primarily ......
Read more >
auto-py-to-exe - PyPI
Converts .py to .exe using a simple graphical interface. ... any existing versions of PyInstaller and then execute python -m pip install pyinstaller==3.6...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found