Fresh install of Python 3.6 on Windows 7.
I am presented with the following error when attempting to open Python 3.6:
Fatal Python error: Py_Initialise: unable to load the file system codec
ModuleNotFoundError: No module named 'encodings'
Current thread 0x0000252c (most recent call first):
I've tried:
- Setting the Path, PYTHONPATH, and PYTHONHOME variables to the directory where Python 3.6 is installed, but this has NOT resolved the issue, despite it being presented as a solution in other threads.
- Reinstalling with the 32 bit version and the same error occurs.
- Running with administrator privileges and the same error occurs.
- Copying the
Python36folder to my user folder, setting the Path, PYTHONPATH, and PYTHONHOME variables to this new folder but the same error occurs. - Installing Python 3.6 for all users and just for my user, but the same error occurs.
asked Oct 11, 2017 at 14:37
LarsaSolidor
1332 silver badges12 bronze badges
2 Answers 2
Download this file and place under Lib folder in python directory
Sign up to request clarification or add additional context in comments.
Comments
Thank you, erkysun.
Removing all Python related directory paths from my environment Path, PYTHONPATH, and PYTHONHOME variables solved the issues I was experiencing.
For the benefit of anyone else experiencing this issue in the future, I removed these directory paths by:
- Typing 'env' into my search Windows 7 search bar, and opening 'Edit the system environment variables'
- Clicking the 'Environment Variables...' button in the bottom right hand corner of the dialogue box which appears
- Locating
Path,PYTHONPATH, andPYTHONHOMEand making the appropriate deletions.
Thanks for your help everyone.
answered Oct 13, 2017 at 13:58
LarsaSolidor
1332 silver badges12 bronze badges
Comments
Explore related questions
See similar questions with these tags.
lang-py
PYTHONPATHandPYTHONHOMEis not the solution and actually is generally the problem.PYTHONPATHcan be used -- carefully -- to add directories tosys.path, as long as you're aware it's affectingsys.pathfor every installed interpreter and as long as you never include the installation directory or the "Lib" subdirectory or anything under it.PYTHONHOMEis only required in special cases. It should never be used for a standard Python installation from python.org.where pythonto ensure you're running the right version, and checkset PYTHONto ensure that no Python-specific environment variables are set; if they are, unset them, e.g. runset PYTHONHOME=to clear that variable in the current shell.