472,353 Members | 1,635 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

Re: "AttributeError: 'module' object has noattribute 'getdefaultlocale'" on Python start

Barak, Ron wrote:
Hi Fellow Pythonians,

I stated getting the following when starting Python (2.5.2 on Windows XP):

C:\Documents and Settings\RBARAK>python -v
# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
# D:\Python25\lib\site.pyc matches D:\Python25\lib\site.py
import site # precompiled from D:\Python25\lib\site.pyc
# D:\Python25\lib\os.pyc matches D:\Python25\lib\os.py
import os # precompiled from D:\Python25\lib\os.pyc
import errno # builtin
import nt # builtin
# D:\Python25\lib\ntpath.pyc matches D:\Python25\lib\ntpath.py
import ntpath # precompiled from D:\Python25\lib\ntpath.pyc
# D:\Python25\lib\stat.pyc matches D:\Python25\lib\stat.py
import stat # precompiled from D:\Python25\lib\stat.pyc
# D:\Python25\lib\UserDict.pyc matches D:\Python25\lib\UserDict.py
import UserDict # precompiled from D:\Python25\lib\UserDict.pyc
# D:\Python25\lib\copy_reg.pyc matches D:\Python25\lib\copy_reg.py
import copy_reg # precompiled from D:\Python25\lib\copy_reg.pyc
# D:\Python25\lib\types.pyc matches D:\Python25\lib\types.py
import types # precompiled from D:\Python25\lib\types.pyc
import _types # builtin
import locale # directory
D:\Python25\Lib\site-packages\wx-2.8-msw-unicode\wx\locale
import locale # precompiled from
D:\Python25\Lib\site-packages\wx-2.8-msw-unicode\wx\locale\__init__.pyc
For some reason, when you run "import locale", it's importing wx.locale
instead of the "locale" module from the stdlib. However, I have no idea
why that would be happening... Did you do something to add wx to your
PYTHONPATH? Maybe do "import sys; print sys.path" or "import os; print
os.environ['PYTHONPATH']" to verify this.

(Hopefully someone more knowledgeable than me will come along soon.)
# D:\Python25\lib\codecs.pyc matches D:\Python25\lib\codecs.py
import codecs # precompiled from D:\Python25\lib\codecs.pyc
import _codecs # builtin
import encodings # directory D:\Python25\lib\encodings
# D:\Python25\lib\encodings\__init__.pyc matches
D:\Python25\lib\encodings\__init__.py
import encodings # precompiled from D:\Python25\lib\encodings\__init__.pyc
# D:\Python25\lib\encodings\aliases.pyc matches
D:\Python25\lib\encodings\aliases.py
import encodings.aliases # precompiled from
D:\Python25\lib\encodings\aliases.pyc
'import site' failed; traceback:
Traceback (most recent call last):
File "d:\Python25\lib\site.py", line 415, in <module>
main()
File "d:\Python25\lib\site.py", line 406, in main
aliasmbcs()
File "d:\Python25\lib\site.py", line 357, in aliasmbcs
enc = locale.getdefaultlocale()[1]
AttributeError: 'module' object has no attribute 'getdefaultlocale'
# D:\Python25\lib\warnings.pyc matches D:\Python25\lib\warnings.py
import warnings # precompiled from D:\Python25\lib\warnings.pyc
# D:\Python25\lib\linecache.pyc matches D:\Python25\lib\linecache.py
import linecache # precompiled from D:\Python25\lib\linecache.pyc
Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit
(Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>>>

Has anyone else gotten this error ?
Could anyone suggest a solution ?

Thanks,
Ron.
--
Sep 9 '08 #1
0 1697

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: robert | last post by:
Why can the default locale not be set by its true name? but only by '' ? : PythonWin 2.5 (r25:51908, Sep 19 2006, 09:52:17) on win32. (None,...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.