473,746 Members | 2,294 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Re: "AttributeError : 'module' object has noattribute 'getdefaultloca le'" 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\loca le
import locale # precompiled from
D:\Python25\Lib \site-packages\wx-2.8-msw-unicode\wx\loca le\__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\__in it__.pyc matches
D:\Python25\lib \encodings\__in it__.py
import encodings # precompiled from D:\Python25\lib \encodings\__in it__.pyc
# D:\Python25\lib \encodings\alia ses.pyc matches
D:\Python25\lib \encodings\alia ses.py
import encodings.alias es # precompiled from
D:\Python25\lib \encodings\alia ses.pyc
'import site' failed; traceback:
Traceback (most recent call last):
File "d:\Python25\li b\site.py", line 415, in <module>
File "d:\Python25\li b\site.py", line 406, in main
File "d:\Python25\li b\site.py", line 357, in aliasmbcs
enc = locale.getdefau ltlocale()[1]
AttributeError: 'module' object has no attribute 'getdefaultloca le'
# 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
Type "help", "copyright" , "credits" or "license" for more information.

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

Sep 9 '08 #1
0 1841

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

Similar topics

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, None) Traceback (most recent call last): File "<interactive input>", line 1, in <module> File "C:\Python25\lib\locale.py", line 476, in setlocale return _setlocale(category, locale) Error: unsupported locale setting
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.