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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • black_13

    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
  • Ben Finney

    #2
    Re: AttributeError: 'module' object has no attribute 'letters'

    black_13 <jjosburn@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

    Comment

    • John Machin

      #3
      Re: AttributeError: 'module' object has no attribute 'letters'

      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.

      Comment

      • Gabriel Genellina

        #4
        Re: AttributeError: 'module' object has no attribute 'letters'

        En Mon, 11 Feb 2008 21:33:25 -0200, John Machin <sjmachin@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

        Comment

        • black_13

          #5
          Re: AttributeError: 'module' object has no attribute 'letters'

          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

          Comment

          Working...