472,344 Members | 1,294 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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\lib\site-packages\win32com\client\__init__.py",
line 12, in <module>
import dynamic, gencache, pythoncom
File "C:\Python25\Lib\site-packages\win32com\client\dynamic.py",
line 24, in <module>
import build
File "C:\Python25\lib\site-packages\win32com\client\build.py", line
507, in <module>
valid_identifier_chars = string.letters + string.digits + "_"
AttributeError: 'module' object has no attribute 'letters'

thanks
black_13
Feb 11 '08 #1
4 23256
black_13 <jj******@gmail.comwrites:
what does this error mean?
[...]
valid_identifier_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\lib\site-packages\win32com\client\__init__.py",
line 12, in <module>
import dynamic, gencache, pythoncom
File "C:\Python25\Lib\site-packages\win32com\client\dynamic.py",
line 24, in <module>
import build
File "C:\Python25\lib\site-packages\win32com\client\build.py", line
507, in <module>
valid_identifier_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******@lexicon.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...@lexicon.netwrote:
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\lib\site-packages\win32com\client\__init__.py",
line 12, in <module>
* * import dynamic, gencache, pythoncom
* File "C:\Python25\Lib\site-packages\win32com\client\dynamic.py",
line 24, in <module>
* * import build
* File "C:\Python25\lib\site-packages\win32com\client\build.py", line
507, in <module>
* * valid_identifier_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
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...
4
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...
2
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...
0
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...
0
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(),...
0
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...
4
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...
1
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...
0
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
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
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: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
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: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...

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.