0

I created a Python script (format .py) that works. I would like to convert this file to .exe, to use it in a computer without having Python installed.

How can I do? I have Python from Anaconda3.

What can I do? Thank you!

I followed some instruction found here on Stackoverflow. .I modify the Path in the 'Environment variables' in the windows settings, edited to the Anaconda folder. .I managed to install pip in conda prompt (I guess).

Still, nothing is working. I don't know how to proceed and in general how to do things properly.

Marco
  • 37
  • 1
  • 7
  • Possible duplicate of [Is there a way to compile python application into static binary?](https://stackoverflow.com/questions/39913847/is-there-a-way-to-compile-python-application-into-static-binary) – MrTux Apr 19 '19 at 10:33
  • What you're looking for is to build a static binary. This is detailed here: https://stackoverflow.com/questions/39913847/is-there-a-way-to-compile-python-application-into-static-binary#40057634. – justinpc Apr 19 '19 at 10:25

1 Answers1

2

I personaly use pyinstaller, its available from pip.
But it will not really compile, it will just bundle.
The difference is compiling means translating to real machine code while bundling is creating a big exe file with all your libs and your python interpreter.

Even if pyinstaller create bigger file and is slower than cython (at execution), I prefer it because it work all the time without work (except lunching it).

Jorropo
  • 348
  • 3
  • 12
  • 1
    Thanks! I installed it in Anaconda prompt. But i still don't know how to convert the file. – Marco Apr 19 '19 at 10:48
  • 1
    You should look `pyinstaller --help`. My personal boiler plate is `pyinstaller -F my-script.py` I may also add `-w` to disable console (it will just hide console) and `-i myIcon.ico` to add an icon. (`-F` is to make a single exe, if you don't your exe will come with a lot of other file). – Jorropo Apr 19 '19 at 10:53
  • You will find your exe in the dist folder. – Jorropo Apr 19 '19 at 10:54