Python Error Py_initialize Unable To Load The File System Codec
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us python importerror: no module named 'encodings' Learn more about Stack Overflow the company Business Learn more about hiring developers
Py_initialize: Unable To Load The File System Codec Importerror: No Module Named 'encodings'
or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack
How To Unset Pythonpath
Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Py_Initialize fails - unable to load the file
Lookuperror: No Codec Search Functions Registered: Can't Find Encoding
system codec up vote 25 down vote favorite 4 I am attempting to put together a simple c++ test project that uses python 3.2. The project builds fine but Py_Initialize raises a fatal error: Fatal Python error: Py_Initialize: unable to load the file system codec LookupError: no codec search functions registered: can't find encoding Minimal code: #include
Sign in Pricing Blog Support Search GitHub This repository Watch 115 Star 1,873 Fork 470 pypa/virtualenv Code Issues 263 Pull requests 34 Projects 0 Pulse Graphs New issue Fatal Python raise codecregistryerror error: Py_Initialize: unable to load the file system codec #161 Closed piotr-dobrogost opened py_setpythonhome this Issue Jul 27, 2011 · 5 comments Projects None yet Labels None yet Milestone No milestone fatal python error: py_initialize: unable to get the locale encoding Assignees No one assigned 3 participants piotr-dobrogost commented Jul 27, 2011 When I try to install virtualenv 1.6.4 on Python 3.2.1 64bit on Vista 64bit English I get this error: C:\Users\Piotr>virtualenv --no-site-packages c:\python\virtualenv\pylint-py3.2 http://stackoverflow.com/questions/5694706/py-initialize-fails-unable-to-load-the-file-system-codec New python executable in c:\python\virtualenv\pylint-py3.2\Scripts\python.exe Fatal Python error: Py_Initialize: unable to load the file system codec LookupError: no codec search functions registered: can't find encoding This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. ERROR: The executable c:\python\virtualenv\pylint-py3.2\Scripts\python.exe is not functioning ERROR: It thinks sys.prefix is 'c:\users\piotr' (should be 'c:\python\virtualenv\pylint-py3.2') ERROR: virtualenv is https://github.com/pypa/virtualenv/issues/161 not compatible with this system or executable Note: some Windows users have reported this error when they installed Python for "Only this user". The problem may be resolva ble if you install Python "For all users". (See https://bugs.launchpad.net/virtualenv/+bug/352844) I raised this issue for the first time 4 months ago (then it was virtualenv 1.5.2 and Python 3.2) at https://bitbucket.org/vinay.sajip/virtualenv/issue/1/ Jon Schoning suggests there the problem is due to virtualenv making a link to the encodings folder instead of copying folder. Solution given by Bartosz (BWY) at http://bugs.python.org/issue11288 doesn't apply here as my PYTHONPATH is not set. nholley commented Nov 11, 2011 I have found that I get this error if I open a command-line as administrator. With a user level command-line it seems to work. edit: As you alluded to, the difference seems to be that admins have permission to create symlinks (which then cause Python to break) whereas a non-elevated user can't, so the file are copied over instead. It seems the easiest solution at this stage would to simply not create symlinks if running in a Windows environment. nholley added a commit to nholley/virtualenv that referenced this issue Nov 11, 2011 nholley http://bugs.python.org/issue11288 MSI doesn't work Type: Stage: Components: IDLE, Windows Versions: Python https://bitbucket.org/vinay.sajip/virtualenv/issues/1/fatal-python-error-py_initialize-unable-to 3.2 process Status: closed Resolution: not a bug Dependencies: Superseder: Assigned To: Nosy List: BWY, Matthew.Funke, brian.curtin, loewis, skrah Priority: normal Keywords: 3.2regression Created on 2011-02-22 15:41 by Matthew.Funke, last changed 2011-02-23 18:52 by loewis. This issue is now unable to closed. Messages (12) msg129088 - (view) Author: Matthew Funke (Matthew.Funke) Date: 2011-02-22 15:41 I uninstalled Python 3.1.3 and installed the 32-bit version of Python 3.2 on my 64-bit Win7 box. (My favorite IDE requires the 32-bit version.) trying to run IDLE crashes; running C:\python32\python.exe returns this error: Fatal Python unable to load error: Py_Initialize: unable to load the file system codec LookupError: no codec search functions registered: can't find encoding This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. I tried Googling the error, but couldn't find much help for it. Thoughts? msg129129 - (view) Author: Martin v. Löwis (loewis) * Date: 2011-02-22 21:11 Can anybody reproduce this? msg129130 - (view) Author: Brian Curtin (brian.curtin) * Date: 2011-02-22 21:20 It works fine for me. Just did a 32-bit Python 3.2 install on a Windows 7 64-bit machine and IDLE works. msg129134 - (view) Author: Martin v. Löwis (loewis) * Date: 2011-02-22 21:44 Matthew: please run "python -v", and attach any output it makes to this report. msg129136 - (view) Author: Matthew Funke (Matthew.Funke) Date: 2011-02-22 21:51 Here's the output, in its entirety: ------------------------- C:\Python32>py
Learn how to clone a repository. Clone in SourceTree Atlassian SourceTree is a free Git and Mercurial client for Windows. Atlassian SourceTree is a free Git and Mercurial client for Mac. Vinay Sajip virtualenv Issues Issues Create issue Issue #1 resolved Fatal Python error: Py_Initialize: unable to load the file system codec with Python 3.2 Piotr Dobrogost created an issue 2011-03-13 {{{ !text c:>where python && python --version && python -c "import sys; print(sys.prefix)" c:\program files\Python\3.2\python.exe Python 3.2 c:\program files\python\3.2 c:>where virtualenv && virtualenv --version && virtualenv testenv c:\program files\Python\3.2\Scripts\virtualenv.exe 1.5.1 Overwriting testenv\lib\site.py with new content Overwriting testenv\lib\orig-prefix.txt with new content New python executable in testenv\Scripts\python.exe Fatal Python error: Py_Initialize: unable to load the file system codec LookupError: no codec search functions registered: can't find encoding This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. ERROR: The executable testenv\Scripts\python.exe is not functioning ERROR: It thinks sys.prefix is 'c:\' (should be 'c:\testenv') ERROR: virtualenv is not compatible with this system or executable Note: some Windows users have reported this error when they installed Python for "Only this user". The problem may be resolvable if you install Python "For all users". (See https://bugs.launchpad.net/virtualenv/+bug/352844) c:> }}} The bug mentioned in the note doesn't apply as there's no option to install Python for "Only this user" on Windows for some time now. virtualenv.png Comments (12) Vinay Sajip repo owner I need more information about your environment - it works for me from a clone of this repo (commit 379:1b6aaed76900) on Windows 7 with ActivePython 3.2.0.0. Here is my console session: C:\Users\Vinay\Projects>\python32\Scripts\virtualenv venv New python executable in venv\Scripts\python.exe Installing distribute........................................................... ................................................................................ ................................................................................ ................................................................................ ...............................done. C:\Users\Vinay\Projects>venv\Scripts\activate.bat (venv) C:\Users\Vinay\Projects>python ActivePython 3.2.0.0 (ActiveState Software Inc.) based on Python 3.2 (r32:88445, Feb 21 2011, 11:29:37) [MSC v.1500 32 b