Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Windows 10 x64 - Fatal Python error: Py_Initialize: unable to load the file system codec #10372
Comments
|
|
|
Same issue in Windows 10 x64. Tried in the cmd.exe interpreter and powershell v5.1. I'm running it out of the current directory. Path includes "c:\Python34;c:\python34\scripts".
|
|
@Slaymeister Could you remove the Python 3.4 installation and try again? They may conflict with each other. |
|
What happens if you boot into safe mode and run |
|
I removed Python 3.4 and had the same error. |
|
Check with Maybe post the output here.. |
|
I have such an error only when I try to run the youtube-dl.exe from any directory other than the one in which the youtube-dl.exe resides. Windows 10 x64 |
|
I can reproduce by simply signing Ex:
Relevant: |
|
I guess signtool.exe changes the content of youtube-dl.exe? If so py2exe
can be broken. What's the need of using signtool? youtube-dl.exe is already
signed and the detached signature can be downloaded from
https://yt-dl.org/downloads/latest/youtube-dl.exe.sig
…On Sat, Sep 30, 2017 at 4:56 PM, Romain Cointepas ***@***.***> wrote:
I can reproduce by simply signing youtube-dl.exe using SignTool.
Ex:
1. Download youtube-dl.exe then run it in many different ways (from
same folder, etc.). Always works.
2. Sign it using signtool.exe sign ...
3. Run it with in many different ways, always fails with the following
error:
Fatal Python error: Py_Initialize: unable to load the file system codec
ImportError: No module named 'encodings'
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#10372 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB2RGUCzGOcqiU-vRzUhsjwOVUBtEK6Eks5sngImgaJpZM4Jm9qT>
.
|
|
@yan12125 are you sure When I run |
|
The signature is not included in the executable itself. Instead, it's
stored in an external, detached file, which is available at
https://yt-dl.org/downloads/latest/youtube-dl.exe.sig. You can download
both the executable and the signature and verify it with gpg:
gpg --verify youtube-dl.exe.sig youtube-dl.exe
As a reference, the last paragraph in
http://rg3.github.io/youtube-dl/download.html provides more information and
useful tips.
…On Sat, Sep 30, 2017 at 6:55 PM, Romain Cointepas ***@***.***> wrote:
@yan12125 <https://github.com/yan12125> are you sure youtube-dl.exe
<https://github.com/rg3/youtube-dl/releases/download/2017.09.24/youtube-dl.exe>
is signed?
When I run signtool.exe verify youtube-dl.exe, I get SignTool Error: No
signature found.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#10372 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB2RGWlJE0pbyibHIEZx3UQiRAD6mVt7ks5snh4cgaJpZM4Jm9qT>
.
|
|
@yan12125 Oh got it. I'm shipping youtube-dl as part of an Electron app, and as part of the packaging process I'm signing the main executable and all embedded executables. I've just discovered that in order to sign a py2exe executable, I will need to build youtube-dl myself and detach the library from the exe loader (as explained here: https://medium.com/@bjoernstiel/code-signing-py2exe-executables-a222c0d06d3f). I'm currently trying to figure out how to build youtube-dl on Windows, but that shouldn't be a problem. I just thought I would mention this specific cause as it ends up failing in the exact same way as this issue mentions. |
|
Thanks for the link! Maybe we can sign youtube-dl.exe when building it. Seems it requires buying a certificate to get a valid signature? I'm not sure if getting another signature is worth it - we already have PGP signatures. If there's really a need, could you open a new issue? This issue targets unmodified youtube-dl.exe |
|
@yan12125 New issue created: #14367 Just to clarify here as well, the official youtube-dl release should not be signed (that's really not the problem, and you would encounter the same problem to sign it anyway). The solution simply require an additional build of youtube-dl for windows (one that separate the exe loader and the library, that's it). |

Make sure you are using the latest version: run
youtube-dl --versionand ensure your version is 2016.08.17. If it's not read this FAQ entry and update. Issues with outdated version will be rejected.Before submitting an issue make sure you have:
What is the purpose of your issue?
If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:
Add
-vflag to your command line you run youtube-dl with, copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):Description of your issue, suggested solution and other information
Similar issue:
I found #10053, which reports the same problem, but was closed because the user had placed it in
C:\Windows\System32. I did not place mine in that location.Additional notes: