Skip to main content
 首页 » 编程设计

Python 错误之安装损坏

2025年05月04日9think

每次我使用 help() 然后调用“模块”时,我都会得到回溯。虽然我的安装已损坏,但我从 activestate (python 32) 重新下载并安装了。有什么建议么?它仍然在做同样的事情。

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 
>>>   

请您参考如下方法:

我也遇到过这个问题,它与在您还拥有 pywin32 时从 IDLE 中运行 help() 有关安装包。该软件包还安装了一个使用 Windows MFC 窗口构建的编辑器,称为 Pythonwin。当您从 IDLE 中运行 help() 时,Pythonwin 会拦截该调用,就好像它是从 Pythonwin 调用的一样,并试图为不存在的窗口设置标题。因此错误。

为了绕过我的安装,我进入了 site-packages 目录并删除了 Pythonwin 目录。根据您收到的错误代码,尝试删除 C:\Python32\lib\site-packages\Pythonwin 目录。它将保留其余的 win32 实用程序。