Py_Initialize fails - unable to load the file system codec
So, for some reason the python dll fails to locate the encodings module. The python.exe executable apparently finds it because it has the expected relative path. Modifying the search path works.
The reason for all of this? Don't know but at least it works. I highly suspect a typo on my part somewhere, that's usually the reason for odd bugs it seems.
Fatal Python error: Py_Initialize: unable to load the file system codec & ModuleNotFoundError
I found a working solution from @Calvin1602 (a Stackoverflow user) from this post Py_Initialize fails - unable to load the file system codec
I just ran into the exact same problem (same Python version, OS, code, etc).
You just have to copy Python's Lib/ directory in your program's
working directory ( on VC it's the directory where the .vcproj is )
Related Topics
Normal Mapping Gone Horribly Wrong
Why Do C and C++ Support Memberwise Assignment of Arrays Within Structs, But Not Generally
Is Main() Really Start of a C++ Program
What Is the Efficient Way to Count Set Bits At a Position or Lower
How Is Std::Function Implemented
"\N" or '\N' or Std::Endl to Std::Cout
No Default Constructor Exists For Class
Enforcing Statement Order in C++
Is Std::Vector or Boost::Vector Thread Safe
Why Does C++ Compilation Take So Long
Why Does Int Pointer '++' Increment by 4 Rather Than 1
C++ Pass an Array by Reference
Deprecated Header ≪Codecvt≫ Replacement
How to Read a File Line by Line or a Whole Text File At Once
Check If a String Contains a String in C++