1

I have a new computer and now am installing python / opening powershell I get this message upon opening powershell

Try the new cross-platform PowerShell https://aka.ms/pscore6

Fatal Python error: initfsencoding: unable to load the file system codec ModuleNotFoundError: No module named 'encodings'

Current thread 0x00001370 (most recent call first):
Invoke-Expression : Cannot bind argument to parameter 'Command' because it is an empty string.
At C:\Users\user\Documents\WindowsPowerShell\profile.ps1:4 char:90
+ ... onda.exe" "shell.powershell" "hook") | Out-String | Invoke-Expression
+                                                         ~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:PSObject) [Invoke-Expression], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,Microsoft.PowerShell.Commands.Invo
   keExpressionCommand 

I read this page* (below), my path is set

C:\Users\user\AppData\Local\Programs\Python\Python38-32\Scripts\
C:\Users\user\AppData\Local\Programs\Python\Python38-32\

However I cannot find PYTHONHOME anywhere and I don't know how to add it.

Does anyone know how I can solve this error?

Thank you for reading :)

*Fatal Python error on Windows 10 ModuleNotFoundError: No module named 'encodings'

Phil Young
  • 11
  • 4

1 Answers1

0

The error is caused by your "Current User, Current Host – console" Powershell profile file, line 4, which is located at C:\Users\user\Documents\WindowsPowerShell\profile.ps1

Look at the Line 4, and check if the line is important to you. If not, remove or comment out the line and the error should be gone.

Niko Föhr
  • 28,336
  • 10
  • 93
  • 96
  • Hey there thanks for your reply. The code message that I have put above is automatically sent out as soon as I open powershell. How do I remove this line – Phil Young Jul 17 '20 at 14:40
  • (sorry for the late reply) – Phil Young Jul 17 '20 at 14:41
  • Did you check what you have on line 4 in your `profile.ps1`? – Niko Föhr Jul 17 '20 at 17:35
  • Ahha! You are a genius, thank you. The laptop is second hand and even with a master reset there was "anaconda" had it's hold. Profile.ps1 had this line of code '''(& "C:\Users\user\Anaconda3\Scripts\conda.exe" "shell.powershell" "hook") | Out-String | Invoke-Expression'''. I commented it out and I no longer had the error. Thanks a bunch! – Phil Young Jul 17 '20 at 18:39