I am using jupyter notebook for coding, hence my file format is ipynb. I would like to turn this piece of code into an executable file .exe for later uses.
So far I have managed to get the exe file by going to anaconda prompt, executed the following command
---> pyinstaller --name ‘name of the exe’ python_code.ipynb
This gives me two folders build and dist, both contains .exe file. However, none of them worked. I would like to know why and how to fix it.
by double click on the exe, it shows a black cmd pop up and then it went away. nothing else happens.
-
it is running the scripts just fine it seems (that is think like your python script as an executable. it will open the shell environment, evaluate the module, then close). If you are thinking that it will open the jupyter notebook in browser, then that is not how it works.Arun Karunagath– Arun Karunagath2018年02月02日 00:57:27 +00:00Commented Feb 2, 2018 at 0:57
-
I am not expecting it to open the jupyter notebook. I expect it to execute that piece of code, but I don't see any execution has been done. with given input file, there are no output.Calabaza– Calabaza2018年02月02日 01:01:05 +00:00Commented Feb 2, 2018 at 1:01
-
do you have a sample version of the notebook?Arun Karunagath– Arun Karunagath2018年02月02日 01:04:26 +00:00Commented Feb 2, 2018 at 1:04
-
I believe the code itself its working fine, as I executed it so many time within jupyter notebook environment and it does what suppose to do. I'm wondering what could be the potential issue? like the pyinstaller could only work with .py format file?Calabaza– Calabaza2018年02月02日 01:09:14 +00:00Commented Feb 2, 2018 at 1:09
-
if a command window pops up and disappears, there may be an error you are not seeing. Open up a cmd window and call your .exe from the command line. It will stay open after the execution and you may get further information.RufusVS– RufusVS2019年05月30日 00:43:43 +00:00Commented May 30, 2019 at 0:43
1 Answer 1
Try exporting your .ipynb file to a normal .py file and running pyinstaller on the .py file instead.
You can export as .py by going to File > Download As > Python (.py) in the Jupyter Notebook interface
Comments
Explore related questions
See similar questions with these tags.