473,804 Members | 3,588 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

AttributeError: 'module' object has no attribute 'letters'

what does this error mean?
i am trying to use mark hammonds win32 package.

Traceback (most recent call last):
File "aui2.py", line 11, in <module>
import win32com.client
File "C:\Python25\li b\site-packages\win32c om\client\__ini t__.py",
line 12, in <module>
import dynamic, gencache, pythoncom
File "C:\Python25\Li b\site-packages\win32c om\client\dynam ic.py",
line 24, in <module>
import build
File "C:\Python25\li b\site-packages\win32c om\client\build .py", line
507, in <module>
valid_identifie r_chars = string.letters + string.digits + "_"
AttributeError: 'module' object has no attribute 'letters'

thanks
black_13
Feb 11 '08 #1
4 23448
black_13 <jj******@gmail .comwrites:
what does this error mean?
[...]
valid_identifie r_chars = string.letters + string.digits + "_"
AttributeError: 'module' object has no attribute 'letters'
It means that you're trying to access the attribute 'letters' on a
module that doesn't have that attribute.

You need to find what the value of 'string' is at that point in the
code. If I had to guess, I would say the person who wrote the above
line was expecting 'string' to be bound to the Python standard library
module 'string'; but that the code you have binds that name to some
other module.

--
\ "War is God's way of teaching geography to Americans." -- |
`\ Ambrose Bierce |
_o__) |
Ben Finney
Feb 11 '08 #2
On Feb 12, 9:24 am, black_13 <jjosb...@gmail .comwrote:
what does this error mean?
i am trying to use mark hammonds win32 package.

Traceback (most recent call last):
File "aui2.py", line 11, in <module>
import win32com.client
File "C:\Python25\li b\site-packages\win32c om\client\__ini t__.py",
line 12, in <module>
import dynamic, gencache, pythoncom
File "C:\Python25\Li b\site-packages\win32c om\client\dynam ic.py",
line 24, in <module>
import build
File "C:\Python25\li b\site-packages\win32c om\client\build .py", line
507, in <module>
valid_identifie r_chars = string.letters + string.digits + "_"
AttributeError: 'module' object has no attribute 'letters'

If you have a file called string.py in the same directory as your
script, move/rename/delete it.
Otherwise run python from the command line with the -v option and find
where it's getting the interloper string module from.

Feb 11 '08 #3
En Mon, 11 Feb 2008 21:33:25 -0200, John Machin <sj******@lexic on.net>
escribió:
Otherwise run python from the command line with the -v option and find
where it's getting the interloper string module from.
interloper: my new word of the day. Thanks!

PS: Another way would be to run the script with python -i, and when it
halts, execute:

import string
print string.__file__

--
Gabriel Genellina

Feb 12 '08 #4
On Feb 11, 5:33*pm, John Machin <sjmac...@lexic on.netwrote:
On Feb 12, 9:24 am,black_13<jjo sb...@gmail.com wrote:


what does this error mean?
i am trying to use mark hammonds win32 package.
Traceback (most recent call last):
* File "aui2.py", line 11, in <module>
* * import win32com.client
* File "C:\Python25\li b\site-packages\win32c om\client\__ini t__.py",
line 12, in <module>
* * import dynamic, gencache, pythoncom
* File "C:\Python25\Li b\site-packages\win32c om\client\dynam ic.py",
line 24, in <module>
* * import build
* File "C:\Python25\li b\site-packages\win32c om\client\build .py", line
507, in <module>
* * valid_identifie r_chars = string.letters + string.digits + "_"
AttributeError: 'module' object has no attribute 'letters'

If you have a file called string.py in the same directory as your
script, move/rename/delete it.
Otherwise run python from the command line with the -v option and find
where it's getting the interloper string module from.- Hide quoted text -

- Show quoted text -
You were correct! I went back to my work machine and there it was. For
some
insane reason I had a py file string.py in the same directory as the
script
I was working on.
thanks
black_13
Feb 12 '08 #5

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

Similar topics

2
9530
by: dont bother | last post by:
Hey, I am trying to run the following example from diveintopython import urllib sock = urllib.urlopen("http://diveintopython.org/") htmlSource = sock.read() sock.close() print htmlSource
4
7684
by: adrian | last post by:
I get those errors when I run: /usr/local/bin/SquidClamAV_Redirector.py -c /etc/squid/SquidClamAV_Redirector.conf ################## Traceback (most recent call last): File "/usr/local/bin/SquidClamAV_Redirector.py", line 573, in ? redirector = SquidClamAV_Redirector(config) File "/usr/local/bin/SquidClamAV_Redirector.py", line 145, in __init__
2
3428
by: rsd | last post by:
Hi, I'm trying get Samsung YH-920 mp3 player to work with Debian GNU/Linux. To do that I need to run http://www.paul.sladen.org/toys/samsung-yh-925/yh-925-db-0.1.py script, the idea behind the script is described at http://www.paul.sladen.org/toys/samsung-yh-925/ I'm getting errors and hoping someone could give me some hints, for I have no python background.
0
1647
by: kepioo | last post by:
I am running a script (summary.py) which is calling the method logException in another module ( pytool). Yesterday, ard 18:50, all of a sudden summary.py was throwing the exception : AttributeError: 'module' object has no attribute 'logException' What I did to fix it was to delete the compiled version of the pytool
0
428
by: rkmr.em | last post by:
Hi I built and installed python 2.5 from source and when I do this: opener = urllib2.build_opener(SmartRedirectHandler(), DefaultErrorHandler(), urllib2.HTTPSHandler()) I get this error. AttributeError: 'module' object has no attribute 'HTTPSHandler' What should I do?
0
1862
by: Matt McCredie | last post by:
I built and installed python 2.5 from source and when I do this: You need `_ssl.pyd' for HTTPSHandler to work. I guess, try to figure out why that wasn't built, then build it. I suppose I _might_ be able to give a little more help, but you haven't mentioned what platform you are using. Even then, I'm not an expert on building Python. Matt
4
6122
by: Nikhil | last post by:
I have recently written a small module. When I import the module, I always get the error only when I do -- Traceback (most recent call last): File "<stdin>", line 1, in <module>
1
6387
by: =?iso-8859-1?q?KLEIN_St=E9phane?= | last post by:
Hi, I'm on Ubuntu 8.04.1 I've installed lxml with easy_install lxml command. Now, when I load etree I've this error : $ python Python 2.5.2 (r252:60911, Apr 21 2008, 11:12:42)
0
1980
by: =?iso-8859-1?q?KLEIN_St=E9phane?= | last post by:
Le Mon, 25 Aug 2008 13:50:50 +0000, KLEIN Stéphane a écrit : I've this bug only with lxml2, lxml 1.3.3 work very well. Regards, Stephane
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9579
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10575
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10330
jinu1996
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...
1
10319
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,...
0
10076
tracyyun
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...
1
7616
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4297
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
3
2990
bsmnconsultancy
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.