question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Flet module does not include binaries when installed with Conda on macOS

See original GitHub issue

Trying to package a simple demo app:

╰─ pyinstaller counter.py                                                                                                                           (flet-test) 
291 INFO: PyInstaller: 5.1
291 INFO: Python: 3.10.5 (conda)
320 INFO: Platform: macOS-12.5.1-arm64-i386-64bit
321 INFO: wrote /Users/cls/Documents/Work/Projects/PrototypeFund/Dev/flet-test/counter.spec
326 INFO: UPX is not available.
327 INFO: Extending PYTHONPATH with paths
['/Users/cls/Documents/Work/Projects/PrototypeFund/Dev/flet-test']
697 INFO: checking Analysis
698 INFO: Building Analysis because Analysis-00.toc is non existent
698 INFO: Initializing module dependency graph...
699 INFO: Caching module graph hooks...
707 INFO: Analyzing base_library.zip ...
3546 INFO: Processing pre-find module path hook distutils from '/Users/cls/miniforge3/envs/flet-test/lib/python3.10/site-packages/PyInstaller/hooks/pre_find_module_path/hook-distutils.py'.
3639 INFO: distutils: retargeting to non-venv dir '/Users/cls/miniforge3/envs/flet-test/lib/python3.10'
4468 INFO: Caching module dependency graph...
4565 INFO: running Analysis Analysis-00.toc
4569 INFO: Analyzing /Users/cls/Documents/Work/Projects/PrototypeFund/Dev/flet-test/counter.py
5524 INFO: Processing pre-safe import module hook six.moves from '/Users/cls/miniforge3/envs/flet-test/lib/python3.10/site-packages/PyInstaller/hooks/pre_safe_import_module/hook-six.moves.py'.
5778 INFO: Processing module hooks...
5779 INFO: Loading module hook 'hook-flet.py' from '/Users/cls/miniforge3/envs/flet-test/lib/python3.10/site-packages/flet/__pyinstaller'...
Unable to find "/Users/cls/miniforge3/envs/flet-test/lib/python3.10/site-packages/flet/bin" when adding binary and data files.

This is the full app:


import flet

from flet import icons



def main(page: flet.Page):
    page.title = "Counter"
    page.vertical_alignment = "center"

    text_field = flet.TextField(
        value=0,
        width=100,
        text_align="right",
    )


    def minus_clicked(event):
        text_field.value = int(text_field.value) - 1
        page.update()

    def plus_clicked(event):
        text_field.value = int(text_field.value) + 1
        page.update()

    page.add(
        flet.Row(
            [
                flet.Text("Counter"),
                flet.IconButton(
                    icons.REMOVE,
                    on_click=minus_clicked,
                ),
                text_field,
                flet.IconButton(
                    icons.ADD,
                    on_click=plus_clicked,
                )
            ],
            alignment="center",
        )
    )


flet.app(
    target=main,
)

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
FeodorFitsnercommented, Aug 19, 2022

OK, thanks for confirming it works with pip. I might play with conda sometime later. Would you mind if I rename this issue to “Flet module does not include binaries when installed with Conda on macOS”?

0reactions
clstaudtcommented, Aug 19, 2022

Do you have an idea why conda skips a platform-specific wheel?

I don’t know enough about packaging to have an idea about that.

Testing the pip-installed flet with pyinstaller:

╰─ pyinstaller counter.py --onefile                                                                                             (flet-test-2) 
196 INFO: PyInstaller: 5.3
196 INFO: Python: 3.10.5 (conda)
218 INFO: Platform: macOS-12.5.1-arm64-i386-64bit
219 INFO: wrote /Users/cls/Documents/Work/Projects/PrototypeFund/Dev/flet-test/counter.spec
222 INFO: UPX is not available.
223 INFO: Extending PYTHONPATH with paths
['/Users/cls/Documents/Work/Projects/PrototypeFund/Dev/flet-test']
531 INFO: checking Analysis
531 INFO: Building Analysis because Analysis-00.toc is non existent
531 INFO: Initializing module dependency graph...
533 INFO: Caching module graph hooks...
540 INFO: Analyzing base_library.zip ...
3961 INFO: Processing pre-find module path hook distutils from '/Users/cls/miniforge3/envs/flet-test-2/lib/python3.10/site-packages/PyInstaller/hooks/pre_find_module_path/hook-distutils.py'.
4016 INFO: distutils: retargeting to non-venv dir '/Users/cls/miniforge3/envs/flet-test-2/lib/python3.10'
4892 INFO: Caching module dependency graph...
4987 INFO: running Analysis Analysis-00.toc
4991 INFO: Analyzing /Users/cls/Documents/Work/Projects/PrototypeFund/Dev/flet-test/counter.py
5756 INFO: Processing pre-safe import module hook six.moves from '/Users/cls/miniforge3/envs/flet-test-2/lib/python3.10/site-packages/PyInstaller/hooks/pre_safe_import_module/hook-six.moves.py'.
6008 INFO: Processing module hooks...
6008 INFO: Loading module hook 'hook-flet.py' from '/Users/cls/miniforge3/envs/flet-test-2/lib/python3.10/site-packages/flet/__pyinstaller'...
6010 INFO: Loading module hook 'hook-pkg_resources.py' from '/Users/cls/miniforge3/envs/flet-test-2/lib/python3.10/site-packages/PyInstaller/hooks'...
6459 INFO: Processing pre-safe import module hook win32com from '/Users/cls/miniforge3/envs/flet-test-2/lib/python3.10/site-packages/_pyinstaller_hooks_contrib/hooks/pre_safe_import_module/hook-win32com.py'.
6812 INFO: Loading module hook 'hook-xml.etree.cElementTree.py' from '/Users/cls/miniforge3/envs/flet-test-2/lib/python3.10/site-packages/PyInstaller/hooks'...
6812 INFO: Loading module hook 'hook-lib2to3.py' from '/Users/cls/miniforge3/envs/flet-test-2/lib/python3.10/site-packages/PyInstaller/hooks'...
6834 INFO: Loading module hook 'hook-_tkinter.py' from '/Users/cls/miniforge3/envs/flet-test-2/lib/python3.10/site-packages/PyInstaller/hooks'...
6920 INFO: checking Tree
6920 INFO: Building Tree because Tree-00.toc is non existent
6920 INFO: Building Tree Tree-00.toc
6928 INFO: checking Tree
6928 INFO: Building Tree because Tree-01.toc is non existent
6928 INFO: Building Tree Tree-01.toc
6979 INFO: checking Tree
6980 INFO: Building Tree because Tree-02.toc is non existent
6980 INFO: Building Tree Tree-02.toc
6983 INFO: Loading module hook 'hook-encodings.py' from '/Users/cls/miniforge3/envs/flet-test-2/lib/python3.10/site-packages/PyInstaller/hooks'...
7227 INFO: Loading module hook 'hook-distutils.util.py' from '/Users/cls/miniforge3/envs/flet-test-2/lib/python3.10/site-packages/PyInstaller/hooks'...
7230 INFO: Loading module hook 'hook-platform.py' from '/Users/cls/miniforge3/envs/flet-test-2/lib/python3.10/site-packages/PyInstaller/hooks'...
7230 INFO: Loading module hook 'hook-pickle.py' from '/Users/cls/miniforge3/envs/flet-test-2/lib/python3.10/site-packages/PyInstaller/hooks'...
7232 INFO: Loading module hook 'hook-heapq.py' from '/Users/cls/miniforge3/envs/flet-test-2/lib/python3.10/site-packages/PyInstaller/hooks'...
7233 INFO: Loading module hook 'hook-difflib.py' from '/Users/cls/miniforge3/envs/flet-test-2/lib/python3.10/site-packages/PyInstaller/hooks'...
7234 INFO: Loading module hook 'hook-multiprocessing.util.py' from '/Users/cls/miniforge3/envs/flet-test-2/lib/python3.10/site-packages/PyInstaller/hooks'...
7236 INFO: Loading module hook 'hook-sysconfig.py' from '/Users/cls/miniforge3/envs/flet-test-2/lib/python3.10/site-packages/PyInstaller/hooks'...
7249 INFO: Loading module hook 'hook-xml.py' from '/Users/cls/miniforge3/envs/flet-test-2/lib/python3.10/site-packages/PyInstaller/hooks'...
7282 INFO: Loading module hook 'hook-distutils.py' from '/Users/cls/miniforge3/envs/flet-test-2/lib/python3.10/site-packages/PyInstaller/hooks'...
7297 INFO: Looking for ctypes DLLs
7311 INFO: Analyzing run-time hooks ...
7313 INFO: Including run-time hook '/Users/cls/miniforge3/envs/flet-test-2/lib/python3.10/site-packages/PyInstaller/hooks/rthooks/pyi_rth_inspect.py'
7315 INFO: Including run-time hook '/Users/cls/miniforge3/envs/flet-test-2/lib/python3.10/site-packages/PyInstaller/hooks/rthooks/pyi_rth_subprocess.py'
7316 INFO: Including run-time hook '/Users/cls/miniforge3/envs/flet-test-2/lib/python3.10/site-packages/flet/__pyinstaller/rthooks/pyi_rth_localhost_fletd.py'
7316 INFO: Including run-time hook '/Users/cls/miniforge3/envs/flet-test-2/lib/python3.10/site-packages/PyInstaller/hooks/rthooks/pyi_rth_pkgres.py'
7320 INFO: Including run-time hook '/Users/cls/miniforge3/envs/flet-test-2/lib/python3.10/site-packages/PyInstaller/hooks/rthooks/pyi_rth_pkgutil.py'
7329 INFO: Looking for dynamic libraries
7700 INFO: Looking for eggs
7700 INFO: Python library not in binary dependencies. Doing additional searching...
7703 INFO: Using Python library /Users/cls/miniforge3/envs/flet-test-2/lib/libpython3.10.dylib
7706 INFO: Warnings written to /Users/cls/Documents/Work/Projects/PrototypeFund/Dev/flet-test/build/counter/warn-counter.txt
7736 INFO: Graph cross-reference written to /Users/cls/Documents/Work/Projects/PrototypeFund/Dev/flet-test/build/counter/xref-counter.html
7754 INFO: checking PYZ
7754 INFO: Building PYZ because PYZ-00.toc is non existent
7754 INFO: Building PYZ (ZlibArchive) /Users/cls/Documents/Work/Projects/PrototypeFund/Dev/flet-test/build/counter/PYZ-00.pyz
8160 INFO: Building PYZ (ZlibArchive) /Users/cls/Documents/Work/Projects/PrototypeFund/Dev/flet-test/build/counter/PYZ-00.pyz completed successfully.
8168 INFO: EXE target arch: arm64
8168 INFO: Code signing identity: None
8168 INFO: checking PKG
8168 INFO: Building PKG because PKG-00.toc is non existent
8168 INFO: Building PKG (CArchive) counter.pkg
15460 INFO: Building PKG (CArchive) counter.pkg completed successfully.
15462 INFO: Bootloader /Users/cls/miniforge3/envs/flet-test-2/lib/python3.10/site-packages/PyInstaller/bootloader/Darwin-64bit/run
15462 INFO: checking EXE
15462 INFO: Building EXE because EXE-00.toc is non existent
15462 INFO: Building EXE from EXE-00.toc
15463 INFO: Copying bootloader EXE to /Users/cls/Documents/Work/Projects/PrototypeFund/Dev/flet-test/dist/counter
15463 INFO: Converting EXE to target arch (arm64)
15494 INFO: Removing signature(s) from EXE
15522 INFO: Appending PKG archive to EXE
15554 INFO: Fixing EXE headers for code signing
15560 INFO: Rewriting the executable's macOS SDK version (12.1.0) to match the SDK version of the Python library (11.0.0) in order to avoid inconsistent behavior and potential UI issues in the frozen application.
15561 INFO: Re-signing the EXE
15924 INFO: Building EXE from EXE-00.toc completed successfully.

The resulting dist/counter binary works too.

Read more comments on GitHub >

github_iconTop Results From Across the Web

grpcio or grpcio-tools does not anymore compile with Apple ...
I am using M1 chip macbook air. Any workaround for this issue? 2
Read more >
Installing on macOS - Conda
In your terminal window or Anaconda Prompt, run the command conda list . A list of installed packages appears if it has been...
Read more >
I can't install TensorFlow-macos a… | Apple Developer Forums
This involves installing "Conda", using it to install the dependencies and finally installing tensorflow-macos and tensorflow-metal via "python -m pip install .
Read more >
Installing Cryptography on an Apple Silicon M1 Mac
This issue is due to a mismatch between the libffi header version and the version of libffi the dynamic linker finds.
Read more >
pip install - pip documentation v22.3.1
Install packages from source. Do not use any binary packages. Unix/macOS. python -m pip install SomePackage1 SomePackage2 --no- ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found