{"id":21045013,"url":"https://github.com/quansight/pyinstaller-test","last_synced_at":"2026-04-23T12:31:06.706Z","repository":{"id":98607563,"uuid":"200683389","full_name":"Quansight/pyinstaller-test","owner":"Quansight","description":"Some generic tests for PyInstaller","archived":false,"fork":false,"pushed_at":"2019-08-09T20:10:18.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2026-01-19T22:57:22.072Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Quansight.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-08-05T15:37:00.000Z","updated_at":"2019-08-09T20:10:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"5b8efc9d-d3f4-4520-a4f6-51857d37cb98","html_url":"https://github.com/Quansight/pyinstaller-test","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Quansight/pyinstaller-test","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quansight%2Fpyinstaller-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quansight%2Fpyinstaller-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quansight%2Fpyinstaller-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quansight%2Fpyinstaller-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Quansight","download_url":"https://codeload.github.com/Quansight/pyinstaller-test/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quansight%2Fpyinstaller-test/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32181362,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-23T11:42:27.955Z","status":"ssl_error","status_checked_at":"2026-04-23T11:42:18.877Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T14:19:33.676Z","updated_at":"2026-04-23T12:31:06.674Z","avatar_url":"https://github.com/Quansight.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pyinstaller-test\nSome generic tests for PyInstaller\n\n## pyinstaller tutorial\n\nFirst, you'll need to install pyinstaller and any other packages you want\ninto a conda environment:\n\n```sh\n$ conda create -n bundle python=3.7 pyinstaller other-deps ...\n$ conda activate bundle\n```\n\nNext you'll need a Python file that you want to create an executable\nfrom. Let's call this `test.py`.  The exact contents of this file\nare what will be run by the executable that pyinstaller creates.\nThis target file will normally be the script / entry point for your\napplication. As an overly simple example, let's say that we just\nwant to print the `flask` version, we'd write a script that looks like:\n\n**test.py**\n\n```python\nimport flask\nprint(\"flask version: \" + flask.__version__)\n```\n\nTo create a single, binary executable for this, run pyinstaller\nas follows:\n\n```sh\n(bundle) $ pyinstaller --onefile test.py\n```\n\nThis will create `build/` \u0026 `dist/` directories. Inside of the `dist/`\ndirectory is a `test` executable.  You can run this as:\n\n```sh\n$ ./dist/test\nflask version: 1.1.1\n```\n\n## Important Gotchas\n\nPyInstaller is not perfect at finding all dependencies that it needs to\nlink in. For certain packages it needs a little help by explicitly importing\nmodules in the main script / entry point. Luckily, this is enough to have\npyinstaller work properly.\n\nFor example, numpy requires it `random` subpackage to be expliticly included.\nSo the `test.py` for numpy would look like:\n\n```python\nimport numpy\nimport numpy.random.common\nimport numpy.random.bounded_integers\nimport numpy.random.entropy\n\nprint(\"numpy version:\", numpy.__version__)\n```\n\nFailing to import the random modules will cause lookup failures when you\ngo to run the compiled binary. Unfortunately, this also affects any package\nwhich depends on numpy. So for example, the `test.py` for `h5py` would\nlook like:\n\n```python\nimport numpy\nimport numpy.random.common\nimport numpy.random.bounded_integers\nimport numpy.random.entropy\nimport h5py\n\nprint(\"h5py version:\", h5py.__version__)\n```\n\nPackages that have these kinds of special cases - and what imports they\nneed to be handled properly - are avialble in the `entries/` directory of this\nrepository.\n\n## Generate Test\n\nThis repo also contains a (xonsh) script for creating, compiling, and running\nthese test scripts automatically. It is called `generate.xsh`. You can pass this\na list of installed package names and it will run.  You will have to have xonsh\ninstalled to execute this.\n\n```sh\n(bundle) $ conda install -c conda-forge xonsh\n(bundle) $ ./generate.xsh numpy scikit-learn bz2\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquansight%2Fpyinstaller-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquansight%2Fpyinstaller-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquansight%2Fpyinstaller-test/lists"}