Changelog for PyInstaller¶
Provide setuptools entrypoints to enable other packages to provide PyInstaller hooks specific to that package, along with tests for these hooks.
Maintainers of Python packages requiring hooks are invited to use this new feature and provide up-to-date PyInstaller support along with their package. This is quite easy, see our sample project for more information (#4232, #4301, #4582). Many thanks to Bryan A. Jones for implementing the important parts.
A new package pyinstaller-hooks-contrib provides monthly updated hooks now. This package is installed automatically when installing PyInstaller, but can be updated independently. Many thanks to Legorooj for setting up the new package and moving the hooks there.
includesarguments to the hook utility function
Change the hook collection order so that the hook-priority is command line, then entry-point, then PyInstaller builtins. (#4876)
- (AIX) Include python-malloc labeled libraries in search for libpython. (#4738)
- (win32) Fix Security Alerts caused by subtle implementation differences
between posix anf windows in
- (win32) Fix struct format strings for versioninfo. (#4861)
- (Windows) cv2: bundle the opencv_videoio_ffmpeg*.dll, if available. (#4999)
- (Windows) GLib: bundle the spawn helper executables for g_spawn* API. (#5000)
- (Windows) PySide2.QtNetwork: search for SSL DLLs in PrefixPath in addition to BinariesPath. (#4998)
- (Windows) When building with 32-bit python in onefile mode, set the
requestedExecutionLevelmanifest key every time and embed the manifest. (#4992)
- Allow building on a different drive than the source. (#4820)
- Consider Python<version> as possible library binary path. Fixes issue where python is not found if Python3 is installed via brew on OSX (#4895)
- Ensure shared dependencies from onefile packages can be opened in the bootloader.
- Ensuring repeatable builds of base_library.zip. (#4654)
FileNotFoundErrorshowing up in
utils/misc.pywhich occurs when a namespace was processed as an filename. (#4034)
- Fix multipackaging. The MERGE class will now have the correct relative paths between shared dependencies which can correctly be opened by the bootloader. (#1527, #4303)
- Fix regression when trying to avoid hard-coded paths in .spec files.
- Fix SIGTSTP signal handling to allow typing Ctrl-Z from terminal. (#4244)
- Update the base library to support encrypting Python bytecode (
--keyoption) again. Many thanks to Matteo Bertini for finally fixing this. (#2365, #3093, #3133, #3160, #3198, #3316, #3619, #4241, #4652)
- When stripping the leading parts of paths in compiled code objects, the longest possible import path will now be stripped. (#4922)
- Remove support for Python 2.7. The minimum required version is now Python 3.5. The last version supporting Python 2.7 was PyInstaller 3.6. (#4623)
- Many hooks are now part of the new pyinstaller-hooks-contrib repository. See below for a detailed list.
- Add hook for
scipy.stats._stats(needed for scipy since 1.5.0). (#4981)
- Prevent hook-nltk from adding non-existing directories. (#3900)
importlib_resourceshook for modern versions (after 1.1.0). (#4889)
- Fix hidden imports in pkg_resources and packaging (#5044)
- Add yet more hidden imports to pkg_resources hook.
- Mirror the pkg_resources hook for packaging which may or may not be
- Update pkg_resources hook for setuptools v45.0.0.
- Add QtQmlModels to included libraries for QtWebEngine on OS X (#4631).
- Fix detecting Qt5 libraries and dependencies from conda-forge builds (#4636).
- Add an AssertionError message so that users who get an error due to Hook conflicts can resolve it (#4626).
- These hooks have been moved to the new pyinstaller-hooks-contrib repository: BTrees, Crypto, Cryptodome, IPython, OpenGL, OpenGL_accelerate, Xlib, accessible_output2, adios, aliyunsdkcore, amazonproduct, appdirs, appy, astor, astroid, astropy, avro, bacon, boto, boto3, botocore, certifi, clr, countrycode, cryptography, cv2, cx_Oracle, cytoolz, dateparser, dclab, distorm3, dns, docutils, docx, dynaconf, enchant, enzyme, eth_abi, eth_account, eth_hash, eth_keyfile, eth_utils, faker, flex, fmpy, gadfly, gooey, google.*, gst, gtk, h5py, httplib, httplib2, imageio, imageio_ffmpeg, jedi, jinja2, jira, jsonpath_rw_ext, jsonschema, jupyterlab, kinterbasdb, langcodes, lensfunpy, libaudioverse, llvmlite, logilab, lxml, lz4, magic, mako, markdown, migrate, mpl_toolkits, mssql, mysql, nacl, names, nanite, nbconvert, nbdime, nbformat, ncclient, netCDF4, nltk, nnpy, notebook, numba, openpyxl, osgeo, passlib, paste, patsy, pendulum, phonenumbers, pint, pinyin, psychopy, psycopg2, pubsub, pyarrow, pycountry, pycparser, pyexcel, pyexcelerate, pylint, pymssql, pyodbc, pyopencl, pyproj, pysnmp, pytest, pythoncom, pyttsx, pywintypes, pywt, radicale, raven, rawpy, rdflib, redmine, regex, reportlab, reportlab, resampy, selenium, shapely, skimage, sklearn, sound_lib, sounddevice, soundfile, speech_recognition, storm, tables, tcod, tensorflow, tensorflow_corethon, text_unidecode, textdistance, torch, ttkthemes, ttkwidgets, u1db, umap, unidecode, uniseg, usb, uvloop, vtkpython, wavefile, weasyprint, web3, webrtcvad, webview, win32com, wx, xml.dom, xml.sax, xsge_gui, zeep, zmq.
- These hooks have been added while now moved to the new pyinstaller-hooks-contrib repository: astor (#4400, #4704), argon2 (#4625) bcrypt. (#4735), (Bluetooth Low Energy platform Agnostic Klient for Python) (#4649) jaraco.text (#4576, #4632), LightGBM. (#4634), xmldiff (#4680), puremagic (identify a file based off it’s magic numbers) (#4709) webassets (#4760), tensorflow_core (to support tensorflow module forwarding logic (#4400, #4704)
- These changes have been applied to hooks now moved to the new pyinstaller-hooks-contrib repository
- Rework bootloader from using strcpy/strncpy with “is this string terminated”-check to use snprintf(); check succes at more places. (This started from fixing GCC warnings for strncpy and strncat.)
- Fix: When copying files, too much data was copied in most cases. This corrupted the file and inhibited using shared dependencies. (#4303)
- In debug and windowed mode, show the traceback in dialogs to help debug pyiboot01_bootstrap errors. (#4213, #4592)
- Started a small test-suite for bootloader basic functions. (#4585)
- (AIX) The argument -X32 or -X64 is not recognized by the AIX loader - so this code needs to be removed. (#4730, #4731)
- (OSX) Allow end users to override MACOSX_DEPLOYMENT_TARGET and mmacosx-version-min via environment variables and set 10.7 as the fallback value for both. (#4677)
- Do not print info about
--noconfirmwhen option is already being used. (#4727)
- Update waf to version 2.0.20 (#4839)
Important: This is the last release of PyInstaller supporting Python 2.7. Python 2 is end-of-life, many packages are about to drop support for Python 2.7 - or already did it.
[SECURITY] (Win32) Fix CVE-2019-16784: Local Privilege Escalation caused by insecure directory permissions of sys._MEIPATH. This security fix effects all Windows software frozen by PyInstaller in “onefile” mode. While PyInstaller itself was not vulnerable, all Windows software frozen by PyInstaller in “onefile” mode is vulnerable.
If you are using PyInstaller to freeze Windows software using “onefile” mode, you should upgrade PyInstaller and rebuild your software.
- (Windows) Allow usage of VSVersionInfo as version argument to EXE again. (#4381, #4539)
- (Windows) Fix MSYS2 dll’s are not found by modulegraph. (#4125, #4417)
- (Windows) The temporary copy of bootloader used add resources, icons, etc. is not created in –workpath instead of in %TEMP%. This fixes issues on systems where the anti-virus cleans %TEMP% immediatly. (#3869)
- Do not fail the build when
ldconfigis missing/inoperable. (#4261)
- Fixed loading of IPython extensions. (#4271)
- Fixed pre-find-module-path hook for distutils to be compatible with virtualenv >= 16.3. (#4064, #4372)
- Improve error reporting when the Python library can’t be found. (#4162)
- Add hook for avro (serialization and RPC framework) (#4388), django-babel (#4516), enzyme (#4338), google.api (resp. google.api.core) (#3251), google.cloud.bigquery (#4083, #4084), google.cloud.pubsub (#4446), google.cloud.speech (#3888), nnpy (#4483), passlib (#4520), pyarrow (#3720, #4517), pyexcel and its plugins io, ods, ods3, odsr, xls, xlsx, xlsxw (#4305), pysnmp (#4287), scrapy (#4514), skimage.io (#3934), sklearn.mixture (#4612), sounddevice on macOS and Windows (#4498), text-unidecode (#4327, #4530), the google-cloud-kms client library (#4408), ttkwidgets (#4484), and webrtcvad (#4490).
- Correct the location of Qt translation files. (#4429)
- Exclude imports for pkg_resources to fix bundling issue. (#4263, #4360)
- Fix hook for pywebview to collect all required libraries and data-files. (#4312)
- Fix hook numpy and hook scipy to account for differences in location of extra dlls on Windows. (#4593)
- Fix pysoundfile hook to bundle files correctly on both OSX and Windows. (#4325)
- Fixed hook for pint to also copy metadata as required to retrieve the version at runtime. (#4280)
- Fixed PySide2.QtNetwork hook by mirroring PyQt5 approach. (#4467, #4468)
- Hook for pywebview now collects data files and dynamic libraries only for the correct OS (Windows). Hook for pywebview now bundles only the required ‘lib’ subdirectory. (#4375)
- Update hooks related to PySide2.QtWebEngineWidgets, ensure the relevant supporting files required for a QtWebEngineView are copied into the distribution. (#4377)
- Update PyQt5 loader to support PyQt >=5.12.3. (#4293, #4332)
- Update PyQt5 to package 64-bit SSL support DLLs. (#4321)
- Update PyQt5 to place OpenGL DLLs correctly for PyQt >= 5.12.3. (#4322)
- (GNU/Linux) Make hook for GdkPixbuf compatible with Ubuntu and Debian (#4486).
- (OSX): Added support for appending URL to program arguments when applications is launched from custom protocol handler. (#4397, #4399)
- (POSIX) For one-file binaries, if the program is started via a symlink, the second process now keeps the basename of the symlink. (#3823, #3829)
- (Windows) If bundled with the application, proactivley load
ucrtbase.dllbefore loading the Python library. This works around unresolved symbol errors when loading
python35.dll(or later) on legacy Windows (7, 8, 8.1) systems with Universal CRT update is not installed. (#1566, #2170, #4230)
- Add our own implementation for
strnlento be used on pattforms one of these is missing.
- (MinGW-w64) Fix .rc.o file not found error. (#4501, #4586)
- Add a check whether
- Added OpenBSD support. (#4545)
- Fix build on Solaris 10.
- Fix checking for compiler flags in configure phase. The check for compiler flags actually did never work. (#4278)
- Update url for public key in update-waf script. (#4584)
- Update waf to version 2.0.19.
- (Windows) Force
--windowedoption if first script is a
.pywfile. This might still be overwritten in the spec-file. (#4001)
- Add support for relative paths for icon-files, resource-files and version-resource-files. (#3333, #3444)
- Add support for the RedHat Software Collections (SCL) Python 3.x. (#3536, #3881)
- Install platform-specific dependencies only on that platform. (#4166, #4173)
- New command-line option
--upx-exclude, which allows the user to prevent binaries from being compressed with UPX. (#3821)
- (conda) Fix detection of conda/anaconda platform.
- (GNU/Linux) Fix Anaconda Python library search. (#3885, #4015)
- (Windows) Fix UAC in one-file mode by embedding the manifest. (#1729, #3746)
- (Windows\Py3.7) Now able to locate pylib when VERSION.dll is listed in python.exe PE Header rather than pythonXY.dll (#3942, #3956)
- Avoid errors if PyQt5 or PySide2 is referenced by the modulegraph but isn’t importable. (#3997)
- Correctly parse the
--debug=noarchivecommand-line options. (#3808)
- Don’t treat PyQt5 and PySide2 files as resources in an OS X windowed build. Doing so causes the resulting frozen app to fail under Qt 5.12. (#4237)
- Explicitly specify an encoding of UTF-8 when opening all text files. (#3605)
- Fix appending the content of
datasin a spec files to
binariesinstead of the internal
datas. (#2326, #3694)
- Fix crash when changing from
--onediron consecutive runs. (#3662)
- Fix discovery of Qt paths on Anaconda. (#3740)
- Fix encoding error raised when reading a XML manifest file which includes non-ASCII characters. This error inhibited building an executable which has non-ASCII characters in the filename. (#3478)
- Fix inputs to
Qt5LibraryInfo. Now the core application’s initialization and finalization in addition to system-wide and application-wide settings is safer. (#4121)
- Fix installation with pip 19.0. (#4003)
- Fixes PE-file corruption during version update. (#3142, #3572)
- In the fake ´site` module set USER_BASE to empty string instead of None as Jupyter Notebook requires it to be a ‘str’. (#3945)
- Query PyQt5 to determine if SSL is supported, only adding SSL DLLs if so. In
addition, search the path for SSL DLLs, instead of looking in Qt’s
pywin32-ctypesversion 0.2.0, the minimum version which supports Python 3.7. (#3763)
- Use pkgutil instead of filesystem operations for interacting with the modules. (#4181)
- PyInstaller is no longer tested against Python 3.4, which is end-of-live.
compat.machine()have been replace by variables of the same name. This avoids evaluating the save several times.
- Require an option for the
--debugargument, rather than assuming a default of
- Added hooks for aliyunsdkcore (#4228), astropy (#4274), BTrees (#4239), dateparser.utils.strptime (#3790), faker (#3989, #4133), gooey (#3773), GtkSourceView (#3893), imageio_ffmpeg (#4051), importlib_metadata and importlib_resources (#4095), jsonpath_rw_ext (#3841), jupyterlab (#3951), lz4 (#3710), magic (#4267), nanite (#3860), nbconvert (#3947), nbdime (#3949), nbformat (#3946), notebook (#3950), pendulum (#3906), pysoundfile (#3844), python-docx (#2574, #3848), python-wavefile (#3785), pytzdata (#3906), PyWavelets pywt (#4120), pywebview (#3771), radicale (#4109), rdflib (#3708), resampy (#3702), sqlalchemy-migrate (#4250), textdistance (#4239), tcod (#3622), ttkthemes (#4105), and umap-learn (#4165).
- Add runtime hook for certifi. (#3952)
- Updated hook for ‘notebook’ to look in all Jupyter paths reported by jupyter_core. (#4270)
- Fixed hook for ‘notebook’ to only include directories that actually exist. (#4270)
- Fixed pre-safe-import-module hook for setuptools.extern.six. (#3806)
- Fixed QtWebEngine hook on OS X. (#3661)
- Fixed the QtWebEngine hook on distributions which don’t have a NSS subdir (such as Archlinux) (#3758)
- Include dynamically-imported backends in the
- Install platform-specific dependencies only on that platform. (#4168)
- Skip packaging PyQt5 QML files if the QML directory doesn’t exist. (#3864)
- Support ECC in PyCryptodome. (#4212, #4229)
- Updated PySide2 hooks to follow PyQt5 approach. (#3655, #3689, #3724, #4040, #4103, #4136, #4175, #4177, #4198, #4206)
- Updated the jsonschema hook for v3.0+. (#4100)
- Updated the Sphinx hook to correctly package Sphinx 1.8.
- Update the text produced by
--helpto state that the
--debugargument requires an option. Correctly format this argument in the Sphinx build process. (#3737)
Project & Process¶
- Remove the PEP-518 “build-system” table from
pyproject.tomlto fix installation with pip 19.0.
- Add support for folders in COLLECT and BUNDLE. (#3653)
- Completely remove pywin32 dependency, which has erratic releases and the version on pypi may no longer have future releases. Require pywin32-ctypes instead which is pure python. (#3728, #3729)
- modulegraph: Align with upstream version 0.17.
- Now prints a more descriptive error when running a tool fails (instead of dumping a trace-back). (#3772)
- Suppress warnings about missing UCRT dependencies on Win 10. (#1566, #3736)
Test-suite and Continuous Integration¶
- Fix Appveyor failures of
test_stdout_encoding()on Windows Python 3.7 x64. (#4144)
- November update of packages used in testing. Prevent pyup from touching
- Rewrite code to avoid a
RemovedInPytest4Warning: Applying marks directly to parameters is deprecated, please use pytest.param(..., marks=...) instead.
- Run Travis tests under Xenial; remove the deprecated
sudo: falsetag. (#4140)
- Update the Markdown test to comply with Markdown 3.0 changes by using correct syntax for extensions.