I am trying to use pyinstaller
to create a single executable to distribute to users without Python installed.
The script is a very simple one and just to test waters I'm using just a few lines of code as "Guinea Pig".
The Hello World
program - no imports, converts fine.
My Guinea Pig program, which imports matplotlib.pyplot
and plots a list of values, fails.
The issue is known and documented here, although they claim it is fixed, or maybe I can't read correctly.
I think the fix should be available in the "dev version" which should be 3.2.1, and I have installed through pip install --upgrade pyinstaller
, to no avail.
I keep getting the same syntax error, which occurs when reading the
module jinja2\asyncsupport.py
Any idea how to work around this? My project is ultra simple and it just involves matplotlib
, pandas
, reading a file and plotting some data.
I got the same error.
The reason is Jinja2 added new async function for Python3.6 in version 2.9.
Please see http://jinja.pocoo.org/docs/2.9/changelog/#version-2-9-6
There are two ways to avoid this error. Both of these worked for me.
Downgrade jinja2
# using Anaconda
conda install jinja2=2.8.1
# using pip
pip install jinja2==2.8.1
Install dev version of PyInstaller
# install from github
# Don't run "pip install -U pyinstaller" because the dev version is not released yet
pip install git+https://github.com/pyinstaller/pyinstaller.git
# check if "PyInstaller (3.3.dev0+g483dfde)" is in the list
pip list
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With