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

三世轮回 提交于 2019-11-30 18:03:12

I ran into this same issue on Windows 10. Here's how I fixed it:

  1. Open your 'Environment Variables' (Under 'System Properties').
  2. In the window that opens, select the 'Path' row, then click the 'Edit...' button.
  3. There should be two environment variables C:\Python37-32\Scripts\ and C:\Python37-32\ Then click 'OK' (Make sure to check that these path values correspond to the location and version of your Python install.)
  4. Next, in the top portion of the 'Environment Variables' window, look for the PYTHONHOME variable and make sure that it is also set to C:\Python37-32

This issue has been addressed here in this thread. Apparently, running python setup as an administrator AND/OR correctly setting the environment variables solved this issue.

First, don't forget to select "Add Python 3.x to PATH" Before you click on Install now and reboot after installation so that the new path is taken into account by Windows. Second, I had the the same problem with Phython 3 on Windows 7 and 64-bit and I got rid of it by deleting PYTHONPATH and PYTHONHOME from Windows 7 system environment variables because I had a previous installation of python 2 and those paths were pointing to my python 2 directory. I had to simply to delete the PYTHONPATH and PYTHONHOME variables.

even I had the same issue when I installed python 3.7 beta version, I resolved it by following these steps :

  1. if you have nay previous version of python installed and the environment variable and path is set for that version already , just remove the path and env variable

2.run the downloaded python 3.7 exe file as administrator

3.At the end of installation if it asks the permission for path length just click on that. now type "python" in command line and see , it should work.

Not sure why this question is still here without a solution. I just encountered this and solved by this:

  1. Close all CMD or console emulator.

  2. Go to the system environment settings and clear all old Python path or environment settings. Make sure you check the PATH in both User and System settings as well.

  3. Try again python -V and see can you run it or not.

    • If you have removed all Python environment settings, I recommend you to reinstall Python and turn on the Add Python to PATH setting during installation.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!