简体   繁体   中英

Python Error - Broken Installation?

Each time I use help() and then call 'modules' I get a trace back. I though my installation was broken so I re-downloaded and installed from activestate (python 32). Any suggestions? It is still doing the same thing.

ActivePython 3.2.2.3 (ActiveState Software Inc.) based on
Python 3.2.2 (default, Sep  8 2011, 10:56:38) [MSC v.1500 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> help()

Welcome to Python 3.2!  This is the online help utility.

If this is your first time using Python, you should definitely check out
the tutorial on the Internet at http://docs.python.org/tutorial/.

Enter the name of any module, keyword, or topic to get help on writing
Python programs and using Python modules.  To quit this help utility and
return to the interpreter, just type "quit".

To get a list of available modules, keywords, or topics, type "modules",
"keywords", or "topics".  Each module also comes with a one-line summary
of what it does; to list the modules whose summaries contain a given word
such as "spam", type "modules spam".

help> modules

Please wait a moment while I gather a list of all available modules...

AutoComplete        abc                 logging             symtable
AutoCompleteWindow  aboutDialog         macosxSupport       sys
AutoExpand          activestate         macpath             sysconfig
Bindings            adodbapi            macurl2path         tabbedpages
CallTipWindow       afxres              mailbox             tabnanny
CallTips            aifc                mailcap             tarfile
ClassBrowser        antigravity         marshal             telnetlib
CodeContext         argparse            math                tempfile
ColorDelegator      array               mimetypes           test
Debugger            ast                 mmap                testcode
Delegator           asynchat            mmapfile            textView
EditorWindow        asyncore            mmsystem            textwrap
FileList            atexit              modulefinder        this
FormatParagraph     audioop             msilib              threading
GrepDialog          base64              msvcrt              time
HyperParser         bdb                 multiprocessing     timeit
IOBinding           binascii            netbios             timer
IdleHistory         binhex              netrc               tkinter
MultiCall           bisect              nntplib             token
MultiStatusBar      builtins            nt                  tokenize
ObjectBrowser       bz2                 ntpath              trace
OutputWindow        cProfile            ntsecuritycon       traceback
ParenMatch          calendar            nturl2path          tty
PathBrowser         cgi                 numbers             turtle
Percolator          cgitb               odbc                turtledemo
PyParse             chunk               opcode              types
PyShell             cmath               operator            unicodedata
RemoteDebugger      cmd                 optparse            unittest
RemoteObjectBrowser code                os                  urllib
ReplaceDialog       codecs              os2emxpath          uu
RstripExtension     codeop              parser              uuid
ScriptBinding       collections         pdb                 virtualenv
ScrolledList        colorsys            perfmon             warnings
SearchDialog        commctrl            pickle              wave
SearchDialogBase    compileall          pickletools         weakref
SearchEngine        concurrent          pip                 webbrowser
StackViewer         configDialog        pipes               win2kras
ToolTip             configHandler       pkg_resources       win32api
TreeWidget          configHelpSourceEdit pkgutil             win32clipboard
UndoDelegator       configSectionNameDialog platform            win32com
WidgetRedirector    configparser        plistlib            win32con
WindowList          contextlib          poplib              win32console
ZoomHeight          copy                posixpath           win32cred
__future__          copyreg             pprint              win32crypt
_abcoll             csv                 profile             win32cryptcon
_ast                ctypes              pstats              win32event
_bisect             curses              pty                 win32evtlog
_codecs             datetime            py_compile          win32evtlogutil
_codecs_cn          dbi                 pyclbr              win32file
_codecs_hk          dbm                 pydoc               win32gui
_codecs_iso2022     dde                 pydoc_data          win32gui_struct
_codecs_jp          decimal             pyexpat             win32help
_codecs_kr          difflib             pypm                win32inet
_codecs_tw          dis                 pythoncom           win32inetcon
_collections        distutils           pythonselect        win32job
_compat_pickle      doctest             pywin               win32lz
_csv                dummy_threading     pywin32_testutil    win32net
_ctypes             dynOptionMenuWidget pywintypes          win32netcon
_ctypes_test        easy_install        queue               win32pdh
_datetime           email               quopri              win32pdhquery
_dummy_thread       encodings           random              win32pdhutil
_elementtree        errno               rasutil             win32pipe
_functools          filecmp             re                  win32print
_hashlib            fileinput           regcheck            win32process
_heapq              fnmatch             regutil             win32profile
_io                 formatter           reprlib             win32ras
_json               fractions           rlcompleter         win32rcparser
_locale             ftplib              rpc                 win32security
_lsprof             functools           run                 win32service
_markupbase         gc                  runpy               win32serviceutil
_md5                genericpath         sched               win32timezone
_msi                getopt              select              win32trace
_multibytecodec     getpass             servicemanager      win32traceutil
_multiprocessing    gettext             setuptools          win32transaction
_pickle             glob                shelve              win32ts
_pyio               gzip                shlex               win32ui
_random             hashlib             shutil              win32uiole
_sha1               heapq               signal              win32verstamp
_sha256             hmac                site                win32wnet
_sha512             html                smtpd               winerror
_socket             http                smtplib             winioctlcon
_sqlite3            idle                sndhdr              winnt
_sre                idlelib             socket              winperf
_ssl                idlever             socketserver        winreg
_string             imaplib             sqlite3             winsound
_strptime           imghdr              sre_compile         winxpgui
_struct             imp                 sre_constants       winxptheme
_subprocess         importlib           sre_parse           wsgiref
_symtable           inspect             ssl                 xdrlib
_testcapi           io                  sspi                xml
_thread             isapi               sspicon             xmlrpc
_threading_local    itertools           stat                xxsubtype
_tkinter            json                string              zipfile
_warnings           keybindingDialog    stringprep          zipimport
_weakref            keyword             struct              zlib
_weakrefset         lib2to3             subprocess          
_win32sysloader     linecache           sunau               
_winxptheme         locale              symbol              

Enter any module name to get more help.  Or, type "modules spam" to search
for modules whose descriptions contain the word "spam".

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    help()
  File "C:\Python32\lib\site.py", line 465, in __call__
    return pydoc.help(*args, **kwds)
  File "C:\Python32\lib\pydoc.py", line 1757, in __call__
    self.interact()
  File "C:\Python32\lib\pydoc.py", line 1769, in interact
    request = self.getline('help> ')
  File "C:\Python32\lib\pydoc.py", line 1780, in getline
    return input(prompt)
  File "C:\Python32\lib\site-packages\Pythonwin\pywin\framework\app.py", line 367, in Win32RawInput
    ret=dialog.GetSimpleInput(prompt)
  File "C:\Python32\lib\site-packages\Pythonwin\pywin\mfc\dialog.py", line 223, in GetSimpleInput
    if title is None: title=win32ui.GetMainFrame().GetWindowText()
win32ui.error: The frame does not exist
>>>  

I have had this problem too and it has to do with running help() from within IDLE when you also have the pywin32 package installed. The package also installs an editor built with Windows MFC windows called Pythonwin. When you run help() from within IDLE, Pythonwin intercepts the call as if it had been called from Pythonwin and is attempting to set a title to a window that doesn't exist. Hence the error.

To get around it with my installations, I went into the site-packages directory and deleted the Pythonwin directory. From the error code that you received, try deleting the C:\\Python32\\lib\\site-packages\\Pythonwin directory. It will leave the rest of the win32 utilities in place.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM