Python error: "LookupError: no codec search functions registered: can't find encoding"

StackOverflow https://stackoverflow.com/questions/21090123

  •  27-09-2022
  •  | 
  •  

Question

I'm running Enthough Canope python distribution in Windows 7 and cannot run working python in a command line. 'python' brings up:

Python 2.7.3 |CUSTOM| (default, Aug  8 2013, 05:30:12) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

but any python command yields:

>>> x = 5
LookupError: no codec search functions registered: can't find encoding

Any idea why this is happening? I can run ipython perfectly well, but I'm concerned that inability to run basic python is preventing other functionality such as installing new packages. Grateful for assistance.

Était-ce utile?

La solution

Did you make Canopy User Python your default python? My guess is you didn't. Doing so will invoke Canopy's User python executable from the command line and x=5 should work. Another way to achieve the same is to open a "Canopy Command Prompt" window from the Windows Start menu: that will only make Canopy your default python for that session. To access it, Start > All programs > Enthought Canopy > Canopy Command Prompt

One way or another, when you start Canopy's python from the terminal you should see:

C:\Users\jrocher\> python
Enthought Canopy Python 2.7.3 | 32-bit | (default, Dec  2 2013, 16:14:17) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top