How can I convert a .py to .exe for Python?












70















I'm trying to convert a fairly simple Python program to an executable and couldn't find what I was looking for, so I have a few questions (I'm running Python3.6):



The methods of doing this that I have found so far are as follows




  1. downloading an old version of Python and using pyinstaller/py2exe

  2. setting up a virtual environment in 3.6 that will allow me to do 1.

  3. downloading a Python to C++ converter and using that.


Here is what I've tried/what problems I've run into.




  • I installed pyinstaller before the required download before it (pypi-something) so it did not work. After downloading the prerequisite file, pyinstaller still does not recognize it.

  • If I'm setting up a virtualenv in 2.7, do I actually need to have 2.7 installed?

  • similarly, the only python to C++ converters I see work only up until python 3.5 - do I need to download and use this version if attempting this?










share|improve this question




















  • 3





    Not sure why this is downvoted (perhaps because tool recommendations are offtopic for SO), but this question will be useful for others in the future. Similar previous questions have not been marked offtopic, e.g. stackoverflow.com/questions/2136837/…

    – Chris_Rands
    Jan 11 '17 at 14:54











  • Possible duplicate of How to make a Python script standalone executable to run without ANY dependency?

    – Steven M. Vascellaro
    Feb 27 '18 at 18:54
















70















I'm trying to convert a fairly simple Python program to an executable and couldn't find what I was looking for, so I have a few questions (I'm running Python3.6):



The methods of doing this that I have found so far are as follows




  1. downloading an old version of Python and using pyinstaller/py2exe

  2. setting up a virtual environment in 3.6 that will allow me to do 1.

  3. downloading a Python to C++ converter and using that.


Here is what I've tried/what problems I've run into.




  • I installed pyinstaller before the required download before it (pypi-something) so it did not work. After downloading the prerequisite file, pyinstaller still does not recognize it.

  • If I'm setting up a virtualenv in 2.7, do I actually need to have 2.7 installed?

  • similarly, the only python to C++ converters I see work only up until python 3.5 - do I need to download and use this version if attempting this?










share|improve this question




















  • 3





    Not sure why this is downvoted (perhaps because tool recommendations are offtopic for SO), but this question will be useful for others in the future. Similar previous questions have not been marked offtopic, e.g. stackoverflow.com/questions/2136837/…

    – Chris_Rands
    Jan 11 '17 at 14:54











  • Possible duplicate of How to make a Python script standalone executable to run without ANY dependency?

    – Steven M. Vascellaro
    Feb 27 '18 at 18:54














70












70








70


56






I'm trying to convert a fairly simple Python program to an executable and couldn't find what I was looking for, so I have a few questions (I'm running Python3.6):



The methods of doing this that I have found so far are as follows




  1. downloading an old version of Python and using pyinstaller/py2exe

  2. setting up a virtual environment in 3.6 that will allow me to do 1.

  3. downloading a Python to C++ converter and using that.


Here is what I've tried/what problems I've run into.




  • I installed pyinstaller before the required download before it (pypi-something) so it did not work. After downloading the prerequisite file, pyinstaller still does not recognize it.

  • If I'm setting up a virtualenv in 2.7, do I actually need to have 2.7 installed?

  • similarly, the only python to C++ converters I see work only up until python 3.5 - do I need to download and use this version if attempting this?










share|improve this question
















I'm trying to convert a fairly simple Python program to an executable and couldn't find what I was looking for, so I have a few questions (I'm running Python3.6):



The methods of doing this that I have found so far are as follows




  1. downloading an old version of Python and using pyinstaller/py2exe

  2. setting up a virtual environment in 3.6 that will allow me to do 1.

  3. downloading a Python to C++ converter and using that.


Here is what I've tried/what problems I've run into.




  • I installed pyinstaller before the required download before it (pypi-something) so it did not work. After downloading the prerequisite file, pyinstaller still does not recognize it.

  • If I'm setting up a virtualenv in 2.7, do I actually need to have 2.7 installed?

  • similarly, the only python to C++ converters I see work only up until python 3.5 - do I need to download and use this version if attempting this?







python python-3.x exe py2exe python-3.6






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 8 '18 at 15:50









eyllanesc

76.2k103156




76.2k103156










asked Jan 10 '17 at 13:44









user7396807user7396807

364145




364145








  • 3





    Not sure why this is downvoted (perhaps because tool recommendations are offtopic for SO), but this question will be useful for others in the future. Similar previous questions have not been marked offtopic, e.g. stackoverflow.com/questions/2136837/…

    – Chris_Rands
    Jan 11 '17 at 14:54











  • Possible duplicate of How to make a Python script standalone executable to run without ANY dependency?

    – Steven M. Vascellaro
    Feb 27 '18 at 18:54














  • 3





    Not sure why this is downvoted (perhaps because tool recommendations are offtopic for SO), but this question will be useful for others in the future. Similar previous questions have not been marked offtopic, e.g. stackoverflow.com/questions/2136837/…

    – Chris_Rands
    Jan 11 '17 at 14:54











  • Possible duplicate of How to make a Python script standalone executable to run without ANY dependency?

    – Steven M. Vascellaro
    Feb 27 '18 at 18:54








3




3





Not sure why this is downvoted (perhaps because tool recommendations are offtopic for SO), but this question will be useful for others in the future. Similar previous questions have not been marked offtopic, e.g. stackoverflow.com/questions/2136837/…

– Chris_Rands
Jan 11 '17 at 14:54





Not sure why this is downvoted (perhaps because tool recommendations are offtopic for SO), but this question will be useful for others in the future. Similar previous questions have not been marked offtopic, e.g. stackoverflow.com/questions/2136837/…

– Chris_Rands
Jan 11 '17 at 14:54













Possible duplicate of How to make a Python script standalone executable to run without ANY dependency?

– Steven M. Vascellaro
Feb 27 '18 at 18:54





Possible duplicate of How to make a Python script standalone executable to run without ANY dependency?

– Steven M. Vascellaro
Feb 27 '18 at 18:54












6 Answers
6






active

oldest

votes


















75














Steps to convert .py to .exe in Python 3.6




  1. Install Python 3.6.

  2. Install cx_Freeze, (open your command prompt and type pip install cx_Freeze.

  3. Install idna, (open your command prompt and type pip install idna.

  4. Write a .py program named myfirstprog.py.

  5. Create a new python file named setup.py on the current directory of your script.

  6. In the setup.py, code below and save it.

  7. With shift pressed right click on the same directory, so you are able to open a command prompt window.

  8. In the prompt, type python setup.py build

  9. If your script is error free, then there will be no problem on creating application.

  10. Check the newly created folder build. It has another folder in it. Within that folder you can find your application. Run it. Make yourself happy.


See the original script in my blog.



setup.py:



from cx_Freeze import setup, Executable

base = None

executables = [Executable("myfirstprog.py", base=base)]

packages = ["idna"]
options = {
'build_exe': {
'packages':packages,
},
}

setup(
name = "<any name>",
options = options,
version = "<any number>",
description = '<any description>',
executables = executables
)


EDIT:




  • be sure that instead of myfirstprog.py you should put your .pyextension file name as created in step 4;

  • you should include each imported package in your .py into packages list (ex: packages = ["idna", "os","sys"])


  • any name, any number, any description in setup.py file should not remain the same, you should change it accordingly (ex:name = "<first_ever>", version = "0.11", description = '' )

  • the imported packages must be installed before you start step 8.






share|improve this answer





















  • 5





    Is there a way to make it ‘standalone’ executable? If I proceed as you advise in your article, I end up with folder exe.win.32-3.6. which is full of supportive files and directories (like ‘collections/’, ’email’, etc.). Awful a lot for a simple print(‘hello’). I would like to make one, single, executable file, that will run on another computer as is, without the need for other files. Is there a build option for that?

    – FanaticD
    Aug 31 '17 at 9:07











  • cx_freeze ImportError: No module named 'idna'

    – Nae
    Oct 27 '17 at 4:51








  • 1





    @FanaticD Python is not your best bet. Cython (a nightmare to get working) or Nuitka would be your best bet. But getting those working is an achievement in itself.

    – Tetora
    Oct 30 '17 at 13:31











  • Would this work in Python 3.5.3? (The last stable version on Debian 9 Stretch).

    – Gerard
    Aug 20 '18 at 22:03











  • How would I import from sklearn.externals import joblib? as mentioned in the edit, step 2.

    – Jack Stoller
    Aug 22 '18 at 1:31



















39














Python 3.6 still isn't supported by Pyinstaller. So in order to use it you're gonna need Python 3.5 or bellow. I'm not sure about py2exe though.



Anyway, case 1 should be done like this:



Open a cmd window in your Python folder (open a command window and use cd or while holding shift, right click it on Windows Explorer and choose 'Open command window here'). Then just enter



pip install pyinstaller


And that's it.



The simplest way to use it is by entering on your command prompt



pyinstaller file_name.py


For more details on how to use it, take a look at this question.



Update



Python 3.6 is now supported by Pyinstaller






share|improve this answer





















  • 1





    just tested, 3.6 is not supported. It does not load the application.

    – Tetora
    Oct 30 '17 at 13:29






  • 12





    just tested, it does.

    – Alexandr Zarubkin
    Jan 22 '18 at 14:27











  • just tested with python 3.7.0. A lot of warnings though but compiled successfully and running on windows 10

    – Ole_S
    20 hours ago



















7














There is an open source project called auto-py-to-exe on Github. Actually it also just uses Pyinstaller internally but since it is has a simple GUI that controls Pyinstaller it may be a comfortable alternative. It can also output a standalone file in contrast to other solutions. They also provide a video showing how to set it up.



GUI:



Auto Py to Exe



Output:



Output






share|improve this answer


























  • You should have mentioned that it requires MVC++. error: Microsoft Visual C++ 14.0 is required.

    – SKR
    Nov 28 '18 at 0:29



















6














I can't tell you what's best, but a tool I have used with success in the past was cx_freeze. They recently updated (on Jan. 7, '17) to version 5.0.1 and it supports Python 3.6.



Here's the pypi
https://pypi.python.org/pypi/cx_Freeze



Docs show that there is more than one way to do it depending on your needs.
http://cx-freeze.readthedocs.io/en/latest/overview.html



I have not tried it out yet, so I'm going to point to a post where the simple way of doing it was discussed. Some things may or may not have changed though.
How do I use cx_freeze?






share|improve this answer





















  • 7





    Worth mentioning, cxFreeze does not do single-file executables.

    – Eddie Hart
    Mar 19 '17 at 18:15



















1














py2exe is a distutils extension which allows to build standalone Windows executable programs (32-bit and 64-bit) from Python scripts; Python 3.3 and later are supported. It can build console executables, windows (GUI) executables, windows services, and DLL/EXE COM servers.



You can download it here:



https://pypi.org/project/py2exe/






share|improve this answer
























  • Why are people downvoting this? I'm just posting this answer for the sake of helping.

    – Tejas Joshi
    Sep 19 '18 at 9:50



















0














I've been using Nuitka and PyInstaller with my package, PySimpleGUI.



Nuitka
There were issues getting tkinter to compile with Nuikta. One of the project contributors developed a script that fixed the problem.



If you're not using tkinter it may "just work" for you. If you are using tkinter say so and I'll try to get the script and instructions published.



PyInstaller
I'm running 3.6 and PyInstaller is working great!
The command I use to create my exe file is:




pyinstaller -wF myfile.py




The -wF will create a single EXE file. Because all of my programs have a GUI and I do not want to command window to show, the -w option will hide the command window.



This is as close to getting what looks like a Winforms program to run that was written in Python.






share|improve this answer
























    protected by eyllanesc May 8 '18 at 21:13



    Thank you for your interest in this question.
    Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



    Would you like to answer one of these unanswered questions instead?














    6 Answers
    6






    active

    oldest

    votes








    6 Answers
    6






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    75














    Steps to convert .py to .exe in Python 3.6




    1. Install Python 3.6.

    2. Install cx_Freeze, (open your command prompt and type pip install cx_Freeze.

    3. Install idna, (open your command prompt and type pip install idna.

    4. Write a .py program named myfirstprog.py.

    5. Create a new python file named setup.py on the current directory of your script.

    6. In the setup.py, code below and save it.

    7. With shift pressed right click on the same directory, so you are able to open a command prompt window.

    8. In the prompt, type python setup.py build

    9. If your script is error free, then there will be no problem on creating application.

    10. Check the newly created folder build. It has another folder in it. Within that folder you can find your application. Run it. Make yourself happy.


    See the original script in my blog.



    setup.py:



    from cx_Freeze import setup, Executable

    base = None

    executables = [Executable("myfirstprog.py", base=base)]

    packages = ["idna"]
    options = {
    'build_exe': {
    'packages':packages,
    },
    }

    setup(
    name = "<any name>",
    options = options,
    version = "<any number>",
    description = '<any description>',
    executables = executables
    )


    EDIT:




    • be sure that instead of myfirstprog.py you should put your .pyextension file name as created in step 4;

    • you should include each imported package in your .py into packages list (ex: packages = ["idna", "os","sys"])


    • any name, any number, any description in setup.py file should not remain the same, you should change it accordingly (ex:name = "<first_ever>", version = "0.11", description = '' )

    • the imported packages must be installed before you start step 8.






    share|improve this answer





















    • 5





      Is there a way to make it ‘standalone’ executable? If I proceed as you advise in your article, I end up with folder exe.win.32-3.6. which is full of supportive files and directories (like ‘collections/’, ’email’, etc.). Awful a lot for a simple print(‘hello’). I would like to make one, single, executable file, that will run on another computer as is, without the need for other files. Is there a build option for that?

      – FanaticD
      Aug 31 '17 at 9:07











    • cx_freeze ImportError: No module named 'idna'

      – Nae
      Oct 27 '17 at 4:51








    • 1





      @FanaticD Python is not your best bet. Cython (a nightmare to get working) or Nuitka would be your best bet. But getting those working is an achievement in itself.

      – Tetora
      Oct 30 '17 at 13:31











    • Would this work in Python 3.5.3? (The last stable version on Debian 9 Stretch).

      – Gerard
      Aug 20 '18 at 22:03











    • How would I import from sklearn.externals import joblib? as mentioned in the edit, step 2.

      – Jack Stoller
      Aug 22 '18 at 1:31
















    75














    Steps to convert .py to .exe in Python 3.6




    1. Install Python 3.6.

    2. Install cx_Freeze, (open your command prompt and type pip install cx_Freeze.

    3. Install idna, (open your command prompt and type pip install idna.

    4. Write a .py program named myfirstprog.py.

    5. Create a new python file named setup.py on the current directory of your script.

    6. In the setup.py, code below and save it.

    7. With shift pressed right click on the same directory, so you are able to open a command prompt window.

    8. In the prompt, type python setup.py build

    9. If your script is error free, then there will be no problem on creating application.

    10. Check the newly created folder build. It has another folder in it. Within that folder you can find your application. Run it. Make yourself happy.


    See the original script in my blog.



    setup.py:



    from cx_Freeze import setup, Executable

    base = None

    executables = [Executable("myfirstprog.py", base=base)]

    packages = ["idna"]
    options = {
    'build_exe': {
    'packages':packages,
    },
    }

    setup(
    name = "<any name>",
    options = options,
    version = "<any number>",
    description = '<any description>',
    executables = executables
    )


    EDIT:




    • be sure that instead of myfirstprog.py you should put your .pyextension file name as created in step 4;

    • you should include each imported package in your .py into packages list (ex: packages = ["idna", "os","sys"])


    • any name, any number, any description in setup.py file should not remain the same, you should change it accordingly (ex:name = "<first_ever>", version = "0.11", description = '' )

    • the imported packages must be installed before you start step 8.






    share|improve this answer





















    • 5





      Is there a way to make it ‘standalone’ executable? If I proceed as you advise in your article, I end up with folder exe.win.32-3.6. which is full of supportive files and directories (like ‘collections/’, ’email’, etc.). Awful a lot for a simple print(‘hello’). I would like to make one, single, executable file, that will run on another computer as is, without the need for other files. Is there a build option for that?

      – FanaticD
      Aug 31 '17 at 9:07











    • cx_freeze ImportError: No module named 'idna'

      – Nae
      Oct 27 '17 at 4:51








    • 1





      @FanaticD Python is not your best bet. Cython (a nightmare to get working) or Nuitka would be your best bet. But getting those working is an achievement in itself.

      – Tetora
      Oct 30 '17 at 13:31











    • Would this work in Python 3.5.3? (The last stable version on Debian 9 Stretch).

      – Gerard
      Aug 20 '18 at 22:03











    • How would I import from sklearn.externals import joblib? as mentioned in the edit, step 2.

      – Jack Stoller
      Aug 22 '18 at 1:31














    75












    75








    75







    Steps to convert .py to .exe in Python 3.6




    1. Install Python 3.6.

    2. Install cx_Freeze, (open your command prompt and type pip install cx_Freeze.

    3. Install idna, (open your command prompt and type pip install idna.

    4. Write a .py program named myfirstprog.py.

    5. Create a new python file named setup.py on the current directory of your script.

    6. In the setup.py, code below and save it.

    7. With shift pressed right click on the same directory, so you are able to open a command prompt window.

    8. In the prompt, type python setup.py build

    9. If your script is error free, then there will be no problem on creating application.

    10. Check the newly created folder build. It has another folder in it. Within that folder you can find your application. Run it. Make yourself happy.


    See the original script in my blog.



    setup.py:



    from cx_Freeze import setup, Executable

    base = None

    executables = [Executable("myfirstprog.py", base=base)]

    packages = ["idna"]
    options = {
    'build_exe': {
    'packages':packages,
    },
    }

    setup(
    name = "<any name>",
    options = options,
    version = "<any number>",
    description = '<any description>',
    executables = executables
    )


    EDIT:




    • be sure that instead of myfirstprog.py you should put your .pyextension file name as created in step 4;

    • you should include each imported package in your .py into packages list (ex: packages = ["idna", "os","sys"])


    • any name, any number, any description in setup.py file should not remain the same, you should change it accordingly (ex:name = "<first_ever>", version = "0.11", description = '' )

    • the imported packages must be installed before you start step 8.






    share|improve this answer















    Steps to convert .py to .exe in Python 3.6




    1. Install Python 3.6.

    2. Install cx_Freeze, (open your command prompt and type pip install cx_Freeze.

    3. Install idna, (open your command prompt and type pip install idna.

    4. Write a .py program named myfirstprog.py.

    5. Create a new python file named setup.py on the current directory of your script.

    6. In the setup.py, code below and save it.

    7. With shift pressed right click on the same directory, so you are able to open a command prompt window.

    8. In the prompt, type python setup.py build

    9. If your script is error free, then there will be no problem on creating application.

    10. Check the newly created folder build. It has another folder in it. Within that folder you can find your application. Run it. Make yourself happy.


    See the original script in my blog.



    setup.py:



    from cx_Freeze import setup, Executable

    base = None

    executables = [Executable("myfirstprog.py", base=base)]

    packages = ["idna"]
    options = {
    'build_exe': {
    'packages':packages,
    },
    }

    setup(
    name = "<any name>",
    options = options,
    version = "<any number>",
    description = '<any description>',
    executables = executables
    )


    EDIT:




    • be sure that instead of myfirstprog.py you should put your .pyextension file name as created in step 4;

    • you should include each imported package in your .py into packages list (ex: packages = ["idna", "os","sys"])


    • any name, any number, any description in setup.py file should not remain the same, you should change it accordingly (ex:name = "<first_ever>", version = "0.11", description = '' )

    • the imported packages must be installed before you start step 8.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited May 11 '18 at 5:40









    voo_doo

    144114




    144114










    answered Jun 8 '17 at 10:38









    Maria Irudaya Regilan JMaria Irudaya Regilan J

    78836




    78836








    • 5





      Is there a way to make it ‘standalone’ executable? If I proceed as you advise in your article, I end up with folder exe.win.32-3.6. which is full of supportive files and directories (like ‘collections/’, ’email’, etc.). Awful a lot for a simple print(‘hello’). I would like to make one, single, executable file, that will run on another computer as is, without the need for other files. Is there a build option for that?

      – FanaticD
      Aug 31 '17 at 9:07











    • cx_freeze ImportError: No module named 'idna'

      – Nae
      Oct 27 '17 at 4:51








    • 1





      @FanaticD Python is not your best bet. Cython (a nightmare to get working) or Nuitka would be your best bet. But getting those working is an achievement in itself.

      – Tetora
      Oct 30 '17 at 13:31











    • Would this work in Python 3.5.3? (The last stable version on Debian 9 Stretch).

      – Gerard
      Aug 20 '18 at 22:03











    • How would I import from sklearn.externals import joblib? as mentioned in the edit, step 2.

      – Jack Stoller
      Aug 22 '18 at 1:31














    • 5





      Is there a way to make it ‘standalone’ executable? If I proceed as you advise in your article, I end up with folder exe.win.32-3.6. which is full of supportive files and directories (like ‘collections/’, ’email’, etc.). Awful a lot for a simple print(‘hello’). I would like to make one, single, executable file, that will run on another computer as is, without the need for other files. Is there a build option for that?

      – FanaticD
      Aug 31 '17 at 9:07











    • cx_freeze ImportError: No module named 'idna'

      – Nae
      Oct 27 '17 at 4:51








    • 1





      @FanaticD Python is not your best bet. Cython (a nightmare to get working) or Nuitka would be your best bet. But getting those working is an achievement in itself.

      – Tetora
      Oct 30 '17 at 13:31











    • Would this work in Python 3.5.3? (The last stable version on Debian 9 Stretch).

      – Gerard
      Aug 20 '18 at 22:03











    • How would I import from sklearn.externals import joblib? as mentioned in the edit, step 2.

      – Jack Stoller
      Aug 22 '18 at 1:31








    5




    5





    Is there a way to make it ‘standalone’ executable? If I proceed as you advise in your article, I end up with folder exe.win.32-3.6. which is full of supportive files and directories (like ‘collections/’, ’email’, etc.). Awful a lot for a simple print(‘hello’). I would like to make one, single, executable file, that will run on another computer as is, without the need for other files. Is there a build option for that?

    – FanaticD
    Aug 31 '17 at 9:07





    Is there a way to make it ‘standalone’ executable? If I proceed as you advise in your article, I end up with folder exe.win.32-3.6. which is full of supportive files and directories (like ‘collections/’, ’email’, etc.). Awful a lot for a simple print(‘hello’). I would like to make one, single, executable file, that will run on another computer as is, without the need for other files. Is there a build option for that?

    – FanaticD
    Aug 31 '17 at 9:07













    cx_freeze ImportError: No module named 'idna'

    – Nae
    Oct 27 '17 at 4:51







    cx_freeze ImportError: No module named 'idna'

    – Nae
    Oct 27 '17 at 4:51






    1




    1





    @FanaticD Python is not your best bet. Cython (a nightmare to get working) or Nuitka would be your best bet. But getting those working is an achievement in itself.

    – Tetora
    Oct 30 '17 at 13:31





    @FanaticD Python is not your best bet. Cython (a nightmare to get working) or Nuitka would be your best bet. But getting those working is an achievement in itself.

    – Tetora
    Oct 30 '17 at 13:31













    Would this work in Python 3.5.3? (The last stable version on Debian 9 Stretch).

    – Gerard
    Aug 20 '18 at 22:03





    Would this work in Python 3.5.3? (The last stable version on Debian 9 Stretch).

    – Gerard
    Aug 20 '18 at 22:03













    How would I import from sklearn.externals import joblib? as mentioned in the edit, step 2.

    – Jack Stoller
    Aug 22 '18 at 1:31





    How would I import from sklearn.externals import joblib? as mentioned in the edit, step 2.

    – Jack Stoller
    Aug 22 '18 at 1:31













    39














    Python 3.6 still isn't supported by Pyinstaller. So in order to use it you're gonna need Python 3.5 or bellow. I'm not sure about py2exe though.



    Anyway, case 1 should be done like this:



    Open a cmd window in your Python folder (open a command window and use cd or while holding shift, right click it on Windows Explorer and choose 'Open command window here'). Then just enter



    pip install pyinstaller


    And that's it.



    The simplest way to use it is by entering on your command prompt



    pyinstaller file_name.py


    For more details on how to use it, take a look at this question.



    Update



    Python 3.6 is now supported by Pyinstaller






    share|improve this answer





















    • 1





      just tested, 3.6 is not supported. It does not load the application.

      – Tetora
      Oct 30 '17 at 13:29






    • 12





      just tested, it does.

      – Alexandr Zarubkin
      Jan 22 '18 at 14:27











    • just tested with python 3.7.0. A lot of warnings though but compiled successfully and running on windows 10

      – Ole_S
      20 hours ago
















    39














    Python 3.6 still isn't supported by Pyinstaller. So in order to use it you're gonna need Python 3.5 or bellow. I'm not sure about py2exe though.



    Anyway, case 1 should be done like this:



    Open a cmd window in your Python folder (open a command window and use cd or while holding shift, right click it on Windows Explorer and choose 'Open command window here'). Then just enter



    pip install pyinstaller


    And that's it.



    The simplest way to use it is by entering on your command prompt



    pyinstaller file_name.py


    For more details on how to use it, take a look at this question.



    Update



    Python 3.6 is now supported by Pyinstaller






    share|improve this answer





















    • 1





      just tested, 3.6 is not supported. It does not load the application.

      – Tetora
      Oct 30 '17 at 13:29






    • 12





      just tested, it does.

      – Alexandr Zarubkin
      Jan 22 '18 at 14:27











    • just tested with python 3.7.0. A lot of warnings though but compiled successfully and running on windows 10

      – Ole_S
      20 hours ago














    39












    39








    39







    Python 3.6 still isn't supported by Pyinstaller. So in order to use it you're gonna need Python 3.5 or bellow. I'm not sure about py2exe though.



    Anyway, case 1 should be done like this:



    Open a cmd window in your Python folder (open a command window and use cd or while holding shift, right click it on Windows Explorer and choose 'Open command window here'). Then just enter



    pip install pyinstaller


    And that's it.



    The simplest way to use it is by entering on your command prompt



    pyinstaller file_name.py


    For more details on how to use it, take a look at this question.



    Update



    Python 3.6 is now supported by Pyinstaller






    share|improve this answer















    Python 3.6 still isn't supported by Pyinstaller. So in order to use it you're gonna need Python 3.5 or bellow. I'm not sure about py2exe though.



    Anyway, case 1 should be done like this:



    Open a cmd window in your Python folder (open a command window and use cd or while holding shift, right click it on Windows Explorer and choose 'Open command window here'). Then just enter



    pip install pyinstaller


    And that's it.



    The simplest way to use it is by entering on your command prompt



    pyinstaller file_name.py


    For more details on how to use it, take a look at this question.



    Update



    Python 3.6 is now supported by Pyinstaller







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Sep 26 '17 at 1:12









    Joshua Van Deren

    183110




    183110










    answered Jan 10 '17 at 17:23









    Rodrigo NascimentoRodrigo Nascimento

    6591513




    6591513








    • 1





      just tested, 3.6 is not supported. It does not load the application.

      – Tetora
      Oct 30 '17 at 13:29






    • 12





      just tested, it does.

      – Alexandr Zarubkin
      Jan 22 '18 at 14:27











    • just tested with python 3.7.0. A lot of warnings though but compiled successfully and running on windows 10

      – Ole_S
      20 hours ago














    • 1





      just tested, 3.6 is not supported. It does not load the application.

      – Tetora
      Oct 30 '17 at 13:29






    • 12





      just tested, it does.

      – Alexandr Zarubkin
      Jan 22 '18 at 14:27











    • just tested with python 3.7.0. A lot of warnings though but compiled successfully and running on windows 10

      – Ole_S
      20 hours ago








    1




    1





    just tested, 3.6 is not supported. It does not load the application.

    – Tetora
    Oct 30 '17 at 13:29





    just tested, 3.6 is not supported. It does not load the application.

    – Tetora
    Oct 30 '17 at 13:29




    12




    12





    just tested, it does.

    – Alexandr Zarubkin
    Jan 22 '18 at 14:27





    just tested, it does.

    – Alexandr Zarubkin
    Jan 22 '18 at 14:27













    just tested with python 3.7.0. A lot of warnings though but compiled successfully and running on windows 10

    – Ole_S
    20 hours ago





    just tested with python 3.7.0. A lot of warnings though but compiled successfully and running on windows 10

    – Ole_S
    20 hours ago











    7














    There is an open source project called auto-py-to-exe on Github. Actually it also just uses Pyinstaller internally but since it is has a simple GUI that controls Pyinstaller it may be a comfortable alternative. It can also output a standalone file in contrast to other solutions. They also provide a video showing how to set it up.



    GUI:



    Auto Py to Exe



    Output:



    Output






    share|improve this answer


























    • You should have mentioned that it requires MVC++. error: Microsoft Visual C++ 14.0 is required.

      – SKR
      Nov 28 '18 at 0:29
















    7














    There is an open source project called auto-py-to-exe on Github. Actually it also just uses Pyinstaller internally but since it is has a simple GUI that controls Pyinstaller it may be a comfortable alternative. It can also output a standalone file in contrast to other solutions. They also provide a video showing how to set it up.



    GUI:



    Auto Py to Exe



    Output:



    Output






    share|improve this answer


























    • You should have mentioned that it requires MVC++. error: Microsoft Visual C++ 14.0 is required.

      – SKR
      Nov 28 '18 at 0:29














    7












    7








    7







    There is an open source project called auto-py-to-exe on Github. Actually it also just uses Pyinstaller internally but since it is has a simple GUI that controls Pyinstaller it may be a comfortable alternative. It can also output a standalone file in contrast to other solutions. They also provide a video showing how to set it up.



    GUI:



    Auto Py to Exe



    Output:



    Output






    share|improve this answer















    There is an open source project called auto-py-to-exe on Github. Actually it also just uses Pyinstaller internally but since it is has a simple GUI that controls Pyinstaller it may be a comfortable alternative. It can also output a standalone file in contrast to other solutions. They also provide a video showing how to set it up.



    GUI:



    Auto Py to Exe



    Output:



    Output







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Jul 28 '18 at 19:06

























    answered Jul 28 '18 at 13:31









    GabGab

    10215




    10215













    • You should have mentioned that it requires MVC++. error: Microsoft Visual C++ 14.0 is required.

      – SKR
      Nov 28 '18 at 0:29



















    • You should have mentioned that it requires MVC++. error: Microsoft Visual C++ 14.0 is required.

      – SKR
      Nov 28 '18 at 0:29

















    You should have mentioned that it requires MVC++. error: Microsoft Visual C++ 14.0 is required.

    – SKR
    Nov 28 '18 at 0:29





    You should have mentioned that it requires MVC++. error: Microsoft Visual C++ 14.0 is required.

    – SKR
    Nov 28 '18 at 0:29











    6














    I can't tell you what's best, but a tool I have used with success in the past was cx_freeze. They recently updated (on Jan. 7, '17) to version 5.0.1 and it supports Python 3.6.



    Here's the pypi
    https://pypi.python.org/pypi/cx_Freeze



    Docs show that there is more than one way to do it depending on your needs.
    http://cx-freeze.readthedocs.io/en/latest/overview.html



    I have not tried it out yet, so I'm going to point to a post where the simple way of doing it was discussed. Some things may or may not have changed though.
    How do I use cx_freeze?






    share|improve this answer





















    • 7





      Worth mentioning, cxFreeze does not do single-file executables.

      – Eddie Hart
      Mar 19 '17 at 18:15
















    6














    I can't tell you what's best, but a tool I have used with success in the past was cx_freeze. They recently updated (on Jan. 7, '17) to version 5.0.1 and it supports Python 3.6.



    Here's the pypi
    https://pypi.python.org/pypi/cx_Freeze



    Docs show that there is more than one way to do it depending on your needs.
    http://cx-freeze.readthedocs.io/en/latest/overview.html



    I have not tried it out yet, so I'm going to point to a post where the simple way of doing it was discussed. Some things may or may not have changed though.
    How do I use cx_freeze?






    share|improve this answer





















    • 7





      Worth mentioning, cxFreeze does not do single-file executables.

      – Eddie Hart
      Mar 19 '17 at 18:15














    6












    6








    6







    I can't tell you what's best, but a tool I have used with success in the past was cx_freeze. They recently updated (on Jan. 7, '17) to version 5.0.1 and it supports Python 3.6.



    Here's the pypi
    https://pypi.python.org/pypi/cx_Freeze



    Docs show that there is more than one way to do it depending on your needs.
    http://cx-freeze.readthedocs.io/en/latest/overview.html



    I have not tried it out yet, so I'm going to point to a post where the simple way of doing it was discussed. Some things may or may not have changed though.
    How do I use cx_freeze?






    share|improve this answer















    I can't tell you what's best, but a tool I have used with success in the past was cx_freeze. They recently updated (on Jan. 7, '17) to version 5.0.1 and it supports Python 3.6.



    Here's the pypi
    https://pypi.python.org/pypi/cx_Freeze



    Docs show that there is more than one way to do it depending on your needs.
    http://cx-freeze.readthedocs.io/en/latest/overview.html



    I have not tried it out yet, so I'm going to point to a post where the simple way of doing it was discussed. Some things may or may not have changed though.
    How do I use cx_freeze?







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited May 23 '17 at 12:34









    Community

    11




    11










    answered Jan 31 '17 at 9:30









    GerschelGerschel

    6113




    6113








    • 7





      Worth mentioning, cxFreeze does not do single-file executables.

      – Eddie Hart
      Mar 19 '17 at 18:15














    • 7





      Worth mentioning, cxFreeze does not do single-file executables.

      – Eddie Hart
      Mar 19 '17 at 18:15








    7




    7





    Worth mentioning, cxFreeze does not do single-file executables.

    – Eddie Hart
    Mar 19 '17 at 18:15





    Worth mentioning, cxFreeze does not do single-file executables.

    – Eddie Hart
    Mar 19 '17 at 18:15











    1














    py2exe is a distutils extension which allows to build standalone Windows executable programs (32-bit and 64-bit) from Python scripts; Python 3.3 and later are supported. It can build console executables, windows (GUI) executables, windows services, and DLL/EXE COM servers.



    You can download it here:



    https://pypi.org/project/py2exe/






    share|improve this answer
























    • Why are people downvoting this? I'm just posting this answer for the sake of helping.

      – Tejas Joshi
      Sep 19 '18 at 9:50
















    1














    py2exe is a distutils extension which allows to build standalone Windows executable programs (32-bit and 64-bit) from Python scripts; Python 3.3 and later are supported. It can build console executables, windows (GUI) executables, windows services, and DLL/EXE COM servers.



    You can download it here:



    https://pypi.org/project/py2exe/






    share|improve this answer
























    • Why are people downvoting this? I'm just posting this answer for the sake of helping.

      – Tejas Joshi
      Sep 19 '18 at 9:50














    1












    1








    1







    py2exe is a distutils extension which allows to build standalone Windows executable programs (32-bit and 64-bit) from Python scripts; Python 3.3 and later are supported. It can build console executables, windows (GUI) executables, windows services, and DLL/EXE COM servers.



    You can download it here:



    https://pypi.org/project/py2exe/






    share|improve this answer













    py2exe is a distutils extension which allows to build standalone Windows executable programs (32-bit and 64-bit) from Python scripts; Python 3.3 and later are supported. It can build console executables, windows (GUI) executables, windows services, and DLL/EXE COM servers.



    You can download it here:



    https://pypi.org/project/py2exe/







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Sep 19 '18 at 9:03









    Tejas JoshiTejas Joshi

    8310




    8310













    • Why are people downvoting this? I'm just posting this answer for the sake of helping.

      – Tejas Joshi
      Sep 19 '18 at 9:50



















    • Why are people downvoting this? I'm just posting this answer for the sake of helping.

      – Tejas Joshi
      Sep 19 '18 at 9:50

















    Why are people downvoting this? I'm just posting this answer for the sake of helping.

    – Tejas Joshi
    Sep 19 '18 at 9:50





    Why are people downvoting this? I'm just posting this answer for the sake of helping.

    – Tejas Joshi
    Sep 19 '18 at 9:50











    0














    I've been using Nuitka and PyInstaller with my package, PySimpleGUI.



    Nuitka
    There were issues getting tkinter to compile with Nuikta. One of the project contributors developed a script that fixed the problem.



    If you're not using tkinter it may "just work" for you. If you are using tkinter say so and I'll try to get the script and instructions published.



    PyInstaller
    I'm running 3.6 and PyInstaller is working great!
    The command I use to create my exe file is:




    pyinstaller -wF myfile.py




    The -wF will create a single EXE file. Because all of my programs have a GUI and I do not want to command window to show, the -w option will hide the command window.



    This is as close to getting what looks like a Winforms program to run that was written in Python.






    share|improve this answer






























      0














      I've been using Nuitka and PyInstaller with my package, PySimpleGUI.



      Nuitka
      There were issues getting tkinter to compile with Nuikta. One of the project contributors developed a script that fixed the problem.



      If you're not using tkinter it may "just work" for you. If you are using tkinter say so and I'll try to get the script and instructions published.



      PyInstaller
      I'm running 3.6 and PyInstaller is working great!
      The command I use to create my exe file is:




      pyinstaller -wF myfile.py




      The -wF will create a single EXE file. Because all of my programs have a GUI and I do not want to command window to show, the -w option will hide the command window.



      This is as close to getting what looks like a Winforms program to run that was written in Python.






      share|improve this answer




























        0












        0








        0







        I've been using Nuitka and PyInstaller with my package, PySimpleGUI.



        Nuitka
        There were issues getting tkinter to compile with Nuikta. One of the project contributors developed a script that fixed the problem.



        If you're not using tkinter it may "just work" for you. If you are using tkinter say so and I'll try to get the script and instructions published.



        PyInstaller
        I'm running 3.6 and PyInstaller is working great!
        The command I use to create my exe file is:




        pyinstaller -wF myfile.py




        The -wF will create a single EXE file. Because all of my programs have a GUI and I do not want to command window to show, the -w option will hide the command window.



        This is as close to getting what looks like a Winforms program to run that was written in Python.






        share|improve this answer















        I've been using Nuitka and PyInstaller with my package, PySimpleGUI.



        Nuitka
        There were issues getting tkinter to compile with Nuikta. One of the project contributors developed a script that fixed the problem.



        If you're not using tkinter it may "just work" for you. If you are using tkinter say so and I'll try to get the script and instructions published.



        PyInstaller
        I'm running 3.6 and PyInstaller is working great!
        The command I use to create my exe file is:




        pyinstaller -wF myfile.py




        The -wF will create a single EXE file. Because all of my programs have a GUI and I do not want to command window to show, the -w option will hide the command window.



        This is as close to getting what looks like a Winforms program to run that was written in Python.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Sep 22 '18 at 20:30

























        answered Sep 19 '18 at 14:10









        MikeyBMikeyB

        70359




        70359

















            protected by eyllanesc May 8 '18 at 21:13



            Thank you for your interest in this question.
            Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



            Would you like to answer one of these unanswered questions instead?



            Popular posts from this blog

            404 Error Contact Form 7 ajax form submitting

            How to know if a Active Directory user can login interactively

            TypeError: fit_transform() missing 1 required positional argument: 'X'