Title: FatalError: initfsencoding python couldn't find codec Module not found: Encodings
Type: crash Stage: resolved
Components: Installation, Windows Versions: Python 3.7
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Lokesh Chandak, inada.naoki, paul.moore, steve.dower, tim.golden, zach.ware
Priority: normal Keywords:

Created on 2019-06-23 13:57 by Lokesh Chandak, last changed 2019-06-24 15:28 by steve.dower. This issue is now closed.

Messages (5)
msg346322 - (view) Author: Lokesh Chandak (Lokesh Chandak) Date: 2019-06-23 13:57
I encountered this issue when using pip. Whenever I try to install a package, it shows a Fatal error, saying that the module encodings was not found, followed by a reboot.
The blue screen shows this message:
KMode exception not handled.
What failed: dipsp.sys.

I have tried uninstalling and reinstalling python 3.7.3. I have also tried moving back to Python 3.5, because I am certain that this issue didn't exist when I was using that. However I encountered the same issues again.

I can otherwise use the interpreter, and run all my code just fine. Previously installed modules like pandas and numpy also work like usual. The only difficulty I encountered is when attempting to install new packages using pip.

After looking around, I found something about setting PYTHONPATH and PYTHONHOME environment variables, but it didn't work either.
I tried installing python in different locations, but that didn't help either.

I am now stuck because I can't install any modules, (and I lost previously installed modules during clean reinstall).
How do I solve this? And while a solution is found, is there a way to install modules without pip?
msg346330 - (view) Author: Inada Naoki (inada.naoki) * (Python committer) Date: 2019-06-23 16:12
There may be a broken pip.exe in your computer.

Try `python -VV` to check what python are you using.
After that, try `python -m pip`, instead of `pip`.
msg346352 - (view) Author: Lokesh Chandak (Lokesh Chandak) Date: 2019-06-24 05:10
Thank Inada Naoki, I can confirm that python -m pip works as normal and I can resume my work.
However pip is still causing the errors, and not just pip, it was also the same for pip3 and pip3.7 as well as easy_install. I guess I will wait for future updates to solve this.
(Also, just one question: how could python -m pip work but not pip? What are the differences in them?
msg346353 - (view) Author: Inada Naoki (inada.naoki) * (Python committer) Date: 2019-06-24 05:19
You can use `where pip` to find which pip is used.
And you can check `PATH` environment variable and remove unused PATHs.
msg346415 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2019-06-24 15:28
> Also, just one question: how could python -m pip work but not pip? What are the differences in them?

To answer this, "pip" on its own is essentially like writing the full path to a specific python.exe and passing "-m pip". If that Python install has been removed or (more likely in this case) is broken, then you'll get the error you're seeing.

Fixing your PATH as suggested should do it.
Date User Action Args
2019-06-24 15:28:27steve.dowersetmessages: + msg346415
2019-06-24 05:19:22inada.naokisetstatus: open -> closed
resolution: not a bug
messages: + msg346353

stage: resolved
2019-06-24 05:10:21Lokesh Chandaksetmessages: + msg346352
2019-06-23 16:12:48inada.naokisetnosy: + inada.naoki
messages: + msg346330
2019-06-23 13:57:39Lokesh Chandakcreate