简体   繁体   English

ipynb python文件转换为可执行exe文件

[英]ipynb python file to executable exe file

I am using jupyter notebook for coding, hence my file format is ipynb. 我正在使用jupyter笔记本进行编码,因此我的文件格式为ipynb。 I would like to turn this piece of code into an executable file .exe for later uses. 我想将这段代码转换为可执行文件.exe,以供以后使用。

So far I have managed to get the exe file by going to anaconda prompt, executed the following command 到目前为止,我已经设法通过转到anaconda提示符来获取exe文件,执行了以下命令

---> pyinstaller --name 'name of the exe' python_code.ipynb ---> pyinstaller --name'exe的名称'python_code.ipynb

This gives me two folders build and dist, both contains .exe file. 这给了我两个文件夹build和dist,都包含.exe文件。 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. 双击exe,它会弹出黑色cmd,然后消失。 nothing else happens. 什么都没发生。

Try exporting your .ipynb file to a normal .py file and running pyinstaller on the .py file instead. 尝试将.ipynb文件导出为普通的.py文件, pyinstaller.py文件上运行pyinstaller

You can export as .py by going to File > Download As > Python (.py) in the Jupyter Notebook interface 您可以通过在Jupyter Notebook界面中转到File > Download As > Python (.py)导出为.py

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM