title: Fatal Python error: initfsencoding: unable to load the file system codec
body: <p>I have created a .exe file of a simple script with intentions to run it on a server however I cannot seem to figure out what this fault means or find any answers online. The fault code is as follows:</p>
  
  <pre><code>Fatal Python error: initfsencoding: unable to load the file system codec
  ModuleNotFoundError: No module named 'encodings'
  
  Current thread 0x00003c8c (most recent call first):
  </code></pre>
  
  <p>To get this far I used pyinstaller </p>
  
  <pre><code>pyinstaller --onefile MyScript.py
  </code></pre>
  
  <p>When this didn't work I also tried</p>
  
  <pre><code>pyinstaller MyScript.py
  </code></pre>
  
  <p>I am running on windows 10, python 3.7 within admin command prompt, within a C:\ file directory. </p>
  
  <p>My sys.path is</p>
  
  <p>['', 'C:\Users\user\AppData\Local\Programs\Python\Python37-32\python37.zip', 'C:\Users\user\AppData\Local\Programs\Python\Python37-32\DLLs', 'C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib', 'C:\Users\user\AppData\Local\Programs\Python\Python37-32', 'C:\Users\user\AppData\Roaming\Python\Python37\site-packages', 'C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\site-packages', 'C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\site-packages\win32', 'C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\site-packages\win32\lib', 'C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\site-packages\Pythonwin']</p>
  
  <p>Any help is appreciated</p>