pyinstaller / pyinstaller/pyinstaller

Why not run hooks.collect_data_files() by default for all modules or provide an option to do so

Open
#2,065 6 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind:to be discussed
Dominant language
Python
Stars
13.1k
Forks
2k
Avg merge
1d 3h
Merged PRs (30d)
11

Description

In a series of import errors I have been facing in trying to freeze a django application, I was surprised to see how quickly I could solve the data file missing errors for a module (rest_framework) by using PyInstaller.utils.hooks.collect_data_files(..) method. I couldn't help wonder, what prevents from running this utility method on all the modules identified as part of the freeze process by default or atleast have an option in pyinstaller (if we are concerned about file sizes etc) to do so? If we have it as an option - then it could be specified in the trouble shooting doc - to try and run with that option to see if that solves the issues. This could prevent or reduce a lot of grief on user side and also prevent having additional import hooks either on user side or checked into PyInstaller that are just collecting data files. Thoughts ?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing PyInstaller.utils.hooks.collect_data_files(..) and how the freeze process identifies modules. Compare the proposed default behavior with an opt-in option, including file-size implications and the troubleshooting documentation. Done means a decided approach is implemented or documented with clear guidance for missing data files.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.