ImportError: no module named py2exe

前端 未结 6 535
旧巷少年郎
旧巷少年郎 2020-12-18 23:41

I get this error when I try to use one of the py2exe samples with py2exe.

File \"setup.py\", line 22, in ?
   import py2exe
ImportError: no module named py2e         


        
6条回答
  •  天涯浪人
    2020-12-19 00:09

    Sounds like something has installed Python 2.4.3 behind your back, and set that to be the default.

    Short term, try running your script explicitly with Python 2.6 like this:

    c:\Python26\python.exe setup.py ...
    

    Long term, you need to check your system PATH (which it sounds like you've already done) and your file associations, like this:

    C:\Users\rjh>assoc .py
    .py=Python.File
    
    C:\Users\rjh>ftype Python.File
    Python.File="C:\Python26\python.exe" "%1" %*
    

    Simply removing Python 2.4.3 might be a mistake, as presumably something on your system is relying on it. Changing the PATH and file associations to point to Python 2.6 probably won't break whatever thing that is, but I couldn't guarantee it.

提交回复
热议问题