473,883 Members | 1,637 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 23465
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
9537
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
7696
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
3435
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
1652
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
1868
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
6133
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
6397
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
1985
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
9944
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
9793
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
11151
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
10420
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...
0
9582
agi2029
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...
1
7974
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...
0
5804
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...
1
4619
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
2
4225
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.