简体   繁体   中英

Create exe file from script using Pyinstaller in Anaconda environment

I want to create exe file in Anaconda environment using Pyinstaller. First, I have successfully installed Pyinstaller using this code:

conda install -c conda-forge pyinstaller

Then I also have converted my ipynb file to py file using "Download as". Now, when I tried my py code using this code:

python Jumlah.py

I got his error:

File "<ipython-input-7-a5108a3cc2af>", line 1
python Jumlah.py
       ^
SyntaxError: invalid syntax

An when I run Pyinstaller using this code:

pyinstaller --onefile Jumlah.py

I got the same error:

File "<ipython-input-8-405d6dae7a75>", line 1
pyinstaller --onefile Jumlah.py
                      ^
SyntaxError: invalid syntax

So, how can I fix this error?

Your problem is that after downloading the jupyter notebook as.py, your file.py contains lines like "get_ipython().run_line_magic('matplotlib', 'inline')".
You have to delete them first!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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