{"id":1318,"date":"2024-04-21T02:20:58","date_gmt":"2024-04-20T17:20:58","guid":{"rendered":"https:\/\/blog.peddals.com\/?p=1318"},"modified":"2024-04-21T02:20:59","modified_gmt":"2024-04-20T17:20:59","slug":"flet-build-macos-now-works-with-numpy","status":"publish","type":"post","link":"https:\/\/blog.peddals.com\/en\/flet-build-macos-now-works-with-numpy\/","title":{"rendered":"flet build macos now supports NumPy (official bug-fix)"},"content":{"rendered":"\n<p>There was a bug in Flet (version 0.21.0 and 0.21.1) that caused built app with NumPy for macOS to crash immediately after launch. I reported this <a href=\"https:\/\/github.com\/flet-dev\/flet\/issues\/2932\" target=\"_blank\" rel=\"noreferrer noopener\">issue on GitHub<\/a> some time ago, and finally Feodor Fitsner, the author, updated me with a solution. To fix the issue, you simply need to build your Flet app again.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Solution<\/h2>\n\n\n\n<p>Template for Flet version 0.21.2 and the latest version 0.22.0 (as of April 19, 2024) has been modified, according to the author. Flet itself has not been changed. Therefore, if you are using NumPy with a Flet app on macOS, you should be good to go with these versions. Just rebuild now (<code>flet build macos<\/code>) and it should work.<\/p>\n\n\n\n<p>If you&#8217;re running older version of Flet, upgrade to the latest with <code>pip install --upgrade flet<\/code>. You can specify a version as well if needed:<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-zsh\" data-lang=\"ZSH\"><code>pip install flet==0.21.2<\/code><\/pre><\/div>\n\n\n\n<p>I upgraded to 0.22.0 and confirmed my <a href=\"https:\/\/blog.peddals.com\/en\/intro-to-speech-plus-subtitles-player-flet-app\/\" target=\"_blank\" rel=\"noreferrer noopener\">SPS Player app<\/a> built for macOS with NumPy code didn&#8217;t crash by building it again. If not sure your Flet version, try the below command:<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-zsh\" data-lang=\"ZSH\"><code>pip list|grep flet\n\n# result will be like the below:\nflet                  0.21.2\nflet-core             0.21.2\nflet-runtime          0.21.2\n<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Another way<\/h2>\n\n\n\n<p>Adding the below code to your Flet will also resolves the issue, according to the comment in the issue. I won&#8217;t bother as long as my codes work with the recent Flet versions though.<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code>import os\n\nos.environ[&quot;OPENBLAS_NUM_THREADS&quot;] = &quot;1&quot;<\/code><\/pre><\/div>\n\n\n\n<p>In <a href=\"https:\/\/github.com\/flet-dev\/serious-python\/issues\/85\" target=\"_blank\" rel=\"noreferrer noopener\">the related issue<\/a> you can find more, detailed info. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Thanks to the solution<\/h2>\n\n\n\n<p>Flet is open-source software that is available for free, so I didn\u2019t request for update or pressure the author to fix anything. However, I am grateful that they took the time to address this issue and make Flet even better. To contribute to Flet, I continue developing my app with it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Image by Stable Diffusion<\/h2>\n\n\n\n<p>You can see what I wanted from the prompt. The quality of each blog post&#8217;s image is vastly different and it\u2019s getting out of hand. Since I got the M2 Max, I\u2019ve been asking for 6 images with 30 steps and then adjusting the step and prompt or model based on the outcome.<\/p>\n\n\n\n<p>Date:<br>2024-4-20 0:14:30<\/p>\n\n\n\n<p>Model:<br>fruity-mix_split-einsum_compiled<\/p>\n\n\n\n<p>Size:<br>512 x 512<\/p>\n\n\n\n<p>Include in Image:<br>fantazy, realistic painting, a wizard with a magic wand killed misterious creature by fireball<\/p>\n\n\n\n<p>Exclude from Image:<\/p>\n\n\n\n<p>Seed:<br>2031597071<\/p>\n\n\n\n<p>Steps:<br>50<\/p>\n\n\n\n<p>Guidance Scale:<br>20.0<\/p>\n\n\n\n<p>Scheduler:<br>DPM-Solver++<\/p>\n\n\n\n<p>ML Compute Unit:<br>All<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There was a bug in Flet (version 0.21.0 and 0.21.1) that caused built app with NumPy for macOS to crash immedi &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.peddals.com\/en\/flet-build-macos-now-works-with-numpy\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;flet build macos now supports NumPy (official bug-fix)&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":1297,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_locale":"en_US","_original_post":"https:\/\/blog.peddals.com\/?p=1290","footnotes":""},"categories":[24,8,4],"tags":[12,18],"class_list":["post-1318","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-flet","category-macos","category-python","tag-mac","tag-python","en-US"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>flet build macos now supports NumPy (official bug-fix) | Peddals Blog<\/title>\n<meta name=\"description\" content=\"Flet&#039;s bug that caused macOS app with NumPy to crash is fixed\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blog.peddals.com\/en\/flet-build-macos-now-works-with-numpy\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"flet build macos now supports NumPy (official bug-fix) | Peddals Blog\" \/>\n<meta property=\"og:description\" content=\"Flet&#039;s bug that caused macOS app with NumPy to crash is fixed\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blog.peddals.com\/en\/flet-build-macos-now-works-with-numpy\/\" \/>\n<meta property=\"og:site_name\" content=\"Peddals Blog\" \/>\n<meta property=\"article:published_time\" content=\"2024-04-20T17:20:58+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-20T17:20:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/blog.peddals.com\/wp-content\/uploads\/2024\/04\/fantazy-realistic-painting-a-wizard-with-a-magic-wand-killed-misteri.492.2031597071.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"512\" \/>\n\t<meta property=\"og:image:height\" content=\"512\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Handsome\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Handsome\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/en\\\/flet-build-macos-now-works-with-numpy\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/en\\\/flet-build-macos-now-works-with-numpy\\\/\"},\"author\":{\"name\":\"Handsome\",\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/#\\\/schema\\\/person\\\/81b2dabca748c3d11a45722f02d9d994\"},\"headline\":\"flet build macos now supports NumPy (official bug-fix)\",\"datePublished\":\"2024-04-20T17:20:58+00:00\",\"dateModified\":\"2024-04-20T17:20:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/en\\\/flet-build-macos-now-works-with-numpy\\\/\"},\"wordCount\":369,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/#\\\/schema\\\/person\\\/81b2dabca748c3d11a45722f02d9d994\"},\"image\":{\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/en\\\/flet-build-macos-now-works-with-numpy\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/blog.peddals.com\\\/wp-content\\\/uploads\\\/2024\\\/04\\\/fantazy-realistic-painting-a-wizard-with-a-magic-wand-killed-misteri.492.2031597071.jpg\",\"keywords\":[\"mac\",\"Python\"],\"articleSection\":[\"Flet\",\"macOS\",\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/blog.peddals.com\\\/en\\\/flet-build-macos-now-works-with-numpy\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/en\\\/flet-build-macos-now-works-with-numpy\\\/\",\"url\":\"https:\\\/\\\/blog.peddals.com\\\/en\\\/flet-build-macos-now-works-with-numpy\\\/\",\"name\":\"flet build macos now supports NumPy (official bug-fix) | Peddals Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/en\\\/flet-build-macos-now-works-with-numpy\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/en\\\/flet-build-macos-now-works-with-numpy\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/blog.peddals.com\\\/wp-content\\\/uploads\\\/2024\\\/04\\\/fantazy-realistic-painting-a-wizard-with-a-magic-wand-killed-misteri.492.2031597071.jpg\",\"datePublished\":\"2024-04-20T17:20:58+00:00\",\"dateModified\":\"2024-04-20T17:20:59+00:00\",\"description\":\"Flet's bug that caused macOS app with NumPy to crash is fixed\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/en\\\/flet-build-macos-now-works-with-numpy\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/blog.peddals.com\\\/en\\\/flet-build-macos-now-works-with-numpy\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/en\\\/flet-build-macos-now-works-with-numpy\\\/#primaryimage\",\"url\":\"https:\\\/\\\/blog.peddals.com\\\/wp-content\\\/uploads\\\/2024\\\/04\\\/fantazy-realistic-painting-a-wizard-with-a-magic-wand-killed-misteri.492.2031597071.jpg\",\"contentUrl\":\"https:\\\/\\\/blog.peddals.com\\\/wp-content\\\/uploads\\\/2024\\\/04\\\/fantazy-realistic-painting-a-wizard-with-a-magic-wand-killed-misteri.492.2031597071.jpg\",\"width\":512,\"height\":512},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/en\\\/flet-build-macos-now-works-with-numpy\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u30db\u30fc\u30e0\",\"item\":\"https:\\\/\\\/blog.peddals.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"flet build macos now supports NumPy (official bug-fix)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/#website\",\"url\":\"https:\\\/\\\/blog.peddals.com\\\/\",\"name\":\"Peddals Blog\",\"description\":\"AI, LLM, Python, Mac, Pythonista3, iOS, etc. in Japanese and English\",\"publisher\":{\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/#\\\/schema\\\/person\\\/81b2dabca748c3d11a45722f02d9d994\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/blog.peddals.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/#\\\/schema\\\/person\\\/81b2dabca748c3d11a45722f02d9d994\",\"name\":\"Handsome\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/51d7363349ec538c4d62c9ebe89488fd7388729ad0c9dfeebd8bb32ebfb11f17?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/51d7363349ec538c4d62c9ebe89488fd7388729ad0c9dfeebd8bb32ebfb11f17?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/51d7363349ec538c4d62c9ebe89488fd7388729ad0c9dfeebd8bb32ebfb11f17?s=96&d=mm&r=g\",\"caption\":\"Handsome\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/51d7363349ec538c4d62c9ebe89488fd7388729ad0c9dfeebd8bb32ebfb11f17?s=96&d=mm&r=g\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"flet build macos now supports NumPy (official bug-fix) | Peddals Blog","description":"Flet's bug that caused macOS app with NumPy to crash is fixed","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blog.peddals.com\/en\/flet-build-macos-now-works-with-numpy\/","og_locale":"en_US","og_type":"article","og_title":"flet build macos now supports NumPy (official bug-fix) | Peddals Blog","og_description":"Flet's bug that caused macOS app with NumPy to crash is fixed","og_url":"https:\/\/blog.peddals.com\/en\/flet-build-macos-now-works-with-numpy\/","og_site_name":"Peddals Blog","article_published_time":"2024-04-20T17:20:58+00:00","article_modified_time":"2024-04-20T17:20:59+00:00","og_image":[{"width":512,"height":512,"url":"https:\/\/blog.peddals.com\/wp-content\/uploads\/2024\/04\/fantazy-realistic-painting-a-wizard-with-a-magic-wand-killed-misteri.492.2031597071.jpg","type":"image\/jpeg"}],"author":"Handsome","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Handsome","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blog.peddals.com\/en\/flet-build-macos-now-works-with-numpy\/#article","isPartOf":{"@id":"https:\/\/blog.peddals.com\/en\/flet-build-macos-now-works-with-numpy\/"},"author":{"name":"Handsome","@id":"https:\/\/blog.peddals.com\/#\/schema\/person\/81b2dabca748c3d11a45722f02d9d994"},"headline":"flet build macos now supports NumPy (official bug-fix)","datePublished":"2024-04-20T17:20:58+00:00","dateModified":"2024-04-20T17:20:59+00:00","mainEntityOfPage":{"@id":"https:\/\/blog.peddals.com\/en\/flet-build-macos-now-works-with-numpy\/"},"wordCount":369,"commentCount":0,"publisher":{"@id":"https:\/\/blog.peddals.com\/#\/schema\/person\/81b2dabca748c3d11a45722f02d9d994"},"image":{"@id":"https:\/\/blog.peddals.com\/en\/flet-build-macos-now-works-with-numpy\/#primaryimage"},"thumbnailUrl":"https:\/\/blog.peddals.com\/wp-content\/uploads\/2024\/04\/fantazy-realistic-painting-a-wizard-with-a-magic-wand-killed-misteri.492.2031597071.jpg","keywords":["mac","Python"],"articleSection":["Flet","macOS","Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/blog.peddals.com\/en\/flet-build-macos-now-works-with-numpy\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/blog.peddals.com\/en\/flet-build-macos-now-works-with-numpy\/","url":"https:\/\/blog.peddals.com\/en\/flet-build-macos-now-works-with-numpy\/","name":"flet build macos now supports NumPy (official bug-fix) | Peddals Blog","isPartOf":{"@id":"https:\/\/blog.peddals.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/blog.peddals.com\/en\/flet-build-macos-now-works-with-numpy\/#primaryimage"},"image":{"@id":"https:\/\/blog.peddals.com\/en\/flet-build-macos-now-works-with-numpy\/#primaryimage"},"thumbnailUrl":"https:\/\/blog.peddals.com\/wp-content\/uploads\/2024\/04\/fantazy-realistic-painting-a-wizard-with-a-magic-wand-killed-misteri.492.2031597071.jpg","datePublished":"2024-04-20T17:20:58+00:00","dateModified":"2024-04-20T17:20:59+00:00","description":"Flet's bug that caused macOS app with NumPy to crash is fixed","breadcrumb":{"@id":"https:\/\/blog.peddals.com\/en\/flet-build-macos-now-works-with-numpy\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.peddals.com\/en\/flet-build-macos-now-works-with-numpy\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/blog.peddals.com\/en\/flet-build-macos-now-works-with-numpy\/#primaryimage","url":"https:\/\/blog.peddals.com\/wp-content\/uploads\/2024\/04\/fantazy-realistic-painting-a-wizard-with-a-magic-wand-killed-misteri.492.2031597071.jpg","contentUrl":"https:\/\/blog.peddals.com\/wp-content\/uploads\/2024\/04\/fantazy-realistic-painting-a-wizard-with-a-magic-wand-killed-misteri.492.2031597071.jpg","width":512,"height":512},{"@type":"BreadcrumbList","@id":"https:\/\/blog.peddals.com\/en\/flet-build-macos-now-works-with-numpy\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u30db\u30fc\u30e0","item":"https:\/\/blog.peddals.com\/"},{"@type":"ListItem","position":2,"name":"flet build macos now supports NumPy (official bug-fix)"}]},{"@type":"WebSite","@id":"https:\/\/blog.peddals.com\/#website","url":"https:\/\/blog.peddals.com\/","name":"Peddals Blog","description":"AI, LLM, Python, Mac, Pythonista3, iOS, etc. in Japanese and English","publisher":{"@id":"https:\/\/blog.peddals.com\/#\/schema\/person\/81b2dabca748c3d11a45722f02d9d994"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.peddals.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/blog.peddals.com\/#\/schema\/person\/81b2dabca748c3d11a45722f02d9d994","name":"Handsome","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/51d7363349ec538c4d62c9ebe89488fd7388729ad0c9dfeebd8bb32ebfb11f17?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/51d7363349ec538c4d62c9ebe89488fd7388729ad0c9dfeebd8bb32ebfb11f17?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/51d7363349ec538c4d62c9ebe89488fd7388729ad0c9dfeebd8bb32ebfb11f17?s=96&d=mm&r=g","caption":"Handsome"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/51d7363349ec538c4d62c9ebe89488fd7388729ad0c9dfeebd8bb32ebfb11f17?s=96&d=mm&r=g"}}]}},"_links":{"self":[{"href":"https:\/\/blog.peddals.com\/wp-json\/wp\/v2\/posts\/1318","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.peddals.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.peddals.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.peddals.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.peddals.com\/wp-json\/wp\/v2\/comments?post=1318"}],"version-history":[{"count":9,"href":"https:\/\/blog.peddals.com\/wp-json\/wp\/v2\/posts\/1318\/revisions"}],"predecessor-version":[{"id":1328,"href":"https:\/\/blog.peddals.com\/wp-json\/wp\/v2\/posts\/1318\/revisions\/1328"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.peddals.com\/wp-json\/wp\/v2\/media\/1297"}],"wp:attachment":[{"href":"https:\/\/blog.peddals.com\/wp-json\/wp\/v2\/media?parent=1318"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.peddals.com\/wp-json\/wp\/v2\/categories?post=1318"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.peddals.com\/wp-json\/wp\/v2\/tags?post=1318"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}