[Python] Can import py2exe at command prompt and in scripts but can't run setup.py at command...

Discussão em 'Python' iniciado por Stack, Junho 10, 2025.

  1. Stack

    Stack Membro Participativo

    I'm working to take several scripts I've written and create both Mac applications and Windows executables using py2app and py2exe, respectively. I'm doing the Mac work on my own machine and have encountered no problems. For Windows, I'm forced to access my school's computer via Remote Desktop. There I'm using IDLE with Python 3.8 on Windows 10. All python packages are installed by my system administrator.

    py2exe has been installed as the picture below shows:

    [​IMG]

    I'm able to import py2exe at the IDLE shell and import it inside scripts. However, when I try to follow the tutorial at https://www.py2exe.org/index.cgi/Tutorial#Step2 and run the "hello world" example, I encounter a problem. My setup is as shown there:

    from distutils.core import setup
    import py2exe
    setup(console=['hello.py'])


    At the command prompt, I type

    python setup.py py2exe


    But I receive the "ModuleNotFoundError: No module named 'py2exe' found" error message.

    Continue reading...

Compartilhe esta Página