0

I've been trying to use py2exe on a completed script for a while now, but it appears something is not going right with my py2exe installation. Importing py2exe fails. Here's the output in the Python Shell:

 Traceback (most recent call last):
 File "<pyshell#0>", line 1, in <module>
 import py2exe
 ImportError: No module named py2exe

I've checked here, and apparently there should be a folder named py2exe in C:\Python27\Lib\site-packages\.

There is not. I've tried uninstalling/reinstalling a few times but to no avail. Any solutions out there?

For the record I'm running Python 2.7 and py2exe 0.6.9 (the most recent version, and it is compatible with Python 2.7.

Answering questions:

Module Path: ['C:\\Python27\\Lib\\idlelib', 'C:\\Windows\\system32\\python27.zip', 'C:\\Python27\\DLLs', 'C:\\Python27\\lib', 'C:\\Python27\\lib\\plat-win', 'C:\\Python27\\lib\\lib-tk', 'C:\\Python27', 'C:\\Python27\\lib\\site-packages']

Downloaded version of py2exe: py2exe-0.6.9.win64-py2.5.amd64.msi When using the 32-bit alternative, I get an error that says Python version 2.7 required, which was not found in the registry. And I do have python added to the PATH.

Update: I had the wrong py2exe installed. That's embarassing. For the record, I had py2exe-0.6.9.win64-py2.5.amd64.msi, when I should have had py2exe-0.6.9.win64-py2.7.amd64.exe

5
  • 1
    Have you downloaded this version of py2exe ? Commented Mar 4, 2012 at 22:59
  • 1
    Can you show your module path? import sys; print sys.path Commented Mar 4, 2012 at 22:59
  • @CharlesB : The OP says that he already check this ;) Commented Mar 4, 2012 at 23:02
  • I've updated my description to answer some questions. I don't know how to reply directly to comments so that you can see them :/ Commented Mar 4, 2012 at 23:09
  • 2
    That py2exe version is for python 2.5. You should download one for python 2.7. Commented Mar 4, 2012 at 23:12

1 Answer 1

2

Do not include "python" command before the setup.py. This works for me. Just type setup.py py2exe. Note you have to be in the same directory as the python secript you want to turn to executable.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.