0

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.

asked Feb 2, 2018 at 0:32
6
  • 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. Commented 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. Commented Feb 2, 2018 at 1:01
  • do you have a sample version of the notebook? Commented 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? Commented 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. Commented May 30, 2019 at 0:43

1 Answer 1

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

answered Feb 5, 2018 at 15:39
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.