Hi,

For some reason, every Python script I try to run in the Windows command prompt fails to run. I get this output for "python setup.py py2exe":

Traceback (most recent call last):
File "setup.py", line 4, in ?
import py2exe
ImportError: No module named py2exe

I've installed py2exe through it's automatic installer, and I have the folder 'py2exe' in Python24\Lib\site-packages. This error occurs with other scripts, too, but all the scirpts work when I run them through my IDE. It'd just be more convenient in some cases to be able to use the command prompt, so I'd appreciate any help with this.

-Jusa

Recommended Answers

All 4 Replies

The DOS command window is kind of stupid, you have to tell it in detail where every file is.

Thanks for the reply.

I forgot to add, that I typed the full file path to the folder where setup.py was before typing "python setup.py py2exe". Like C:\Python24\Lib\site-packages\py2exe\samples\simple\python setup.py py2exe. But it still doesn't work. I also tried giving setup.py as a full path between quotes, but that didn't work either. It always complains about modules not found.

Thanks for the reply.

I forgot to add, that I typed the full file path to the folder where setup.py was before typing "python setup.py py2exe". Like C:\Python24\Lib\site-packages\py2exe\samples\simple\python setup.py py2exe. But it still doesn't work. I also tried giving setup.py as a full path between quotes, but that didn't work either. It always complains about modules not found.

hi,

Try adding path of py2exe's PATH. I know that the path of libraries is already in included in PATH, but still...... Might that will work.


kath.

I think I figured out why the scirpts didn't work. It seems the problem had to do with the word 'python' in the command I typed into the prompt.

While "C:\blah\python setup.py py2exe" didn't work, "C:\blah\setup.py py2exe" did work. I just had to omit the word 'python'. It seems a bit strange, but now all my scripts work.

Thanks again for the help.

-Jusa

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.