Replies: 5 comments 4 replies
-
The issue here is likely the matplotlib version. matplotlib contains a binary component, so it needs to be compiled; BeeWare has published a pre-compiled version of the matplotlib wheels, but we don't publish every version of matplotlib. At present, 3.6.0 is the only version that we publish. If you've pinned a different matplotlib version, then pip will be trying to compile matplotlib, which won't work. The other possibility is that one of matplotlib's dependencies (contourpy in this case) has recently become a binary dependency. I know that matplotlib 3.6.0 worked as recently as November, but I haven't tried since then. If you need to use a version other than 3.6.0, |
Beta Was this translation helpful? Give feedback.
-
Thanks Russ, I’ll try to get it built with that version. My charts are pretty simple, I’m sure any version of matplotlib is fine if I can build it.
|
Beta Was this translation helpful? Give feedback.
-
I updated toml file to specify 3.6.0, and the 'briefcase create' output
confirmed it was using that wheel, but it still fails on contourpy. See
partial log below. If there's a beeware doc that helps me figure this out,
please let me know, or if anyone has ideas I would very much appreciate to
hear. Or if there's an entirely different charting package that's known to
build for all the platforms, including ios, I'm happy to switch to it -- my
charting is super simple, as long as it can create static PNG's (but note
that plotly failed to build due to its own dependency issues, kaleido in
that case).
Thank you
…_____
Collecting matplotlib==3.6.0
Downloading
https://pypi.anaconda.org/beeware/simple/matplotlib/3.6.0/matplotlib-3.6.0-cp312-cp312-ios_13_0_arm64_iphoneos.whl
(7.3 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7.3/7.3 MB 2.7 MB/s eta
0:00:00
WARNING: Cache entry deserialization failed, entry ignored
Collecting contourpy>=1.0.1 (from matplotlib==3.6.0)
Using cached contourpy-1.3.1.tar.gz (13.5 MB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'error'
error: subprocess-exited-with-error
× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [14 lines of output]
+ meson setup
/private/var/folders/k0/djm3lvm11_v6s0tsstgwylsh0000gn/T/pip-install-fme3_9s5/contourpy_febffcb0f7cd4747b0df3da74d444c5c
/private/var/folders/k0/djm3lvm11_v6s0tsstgwylsh0000gn/T/pip-install-fme3_9s5/contourpy_febffcb0f7cd4747b0df3da74d444c5c/.mesonpy-1__82bbd
-Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --vsenv
--native-file=/private/var/folders/k0/djm3lvm11_v6s0tsstgwylsh0000gn/T/pip-install-fme3_9s5/contourpy_febffcb0f7cd4747b0df3da74d444c5c/.mesonpy-1__82bbd/meson-python-native-file.ini
The Meson build system
Version: 1.6.1
Source dir:
/private/var/folders/k0/djm3lvm11_v6s0tsstgwylsh0000gn/T/pip-install-fme3_9s5/contourpy_febffcb0f7cd4747b0df3da74d444c5c
Build dir:
/private/var/folders/k0/djm3lvm11_v6s0tsstgwylsh0000gn/T/pip-install-fme3_9s5/contourpy_febffcb0f7cd4747b0df3da74d444c5c/.mesonpy-1__82bbd
Build type: native build
Project name: contourpy
Project version: 1.3.1
../meson.build:1:0: ERROR: Unknown compiler(s):
[['Cannot_compile_native_modules']]
The following exception(s) were encountered:
Running `Cannot_compile_native_modules --version` gave "[Errno 2] No
such file or directory: 'Cannot_compile_native_modules'"
A full log can be found at
/private/var/folders/k0/djm3lvm11_v6s0tsstgwylsh0000gn/T/pip-install-fme3_9s5/contourpy_febffcb0f7cd4747b0df3da74d444c5c/.mesonpy-1__82bbd/meson-logs/meson-log.txt
[end of output]
note: This error originates from a subprocess, and is likely not a
problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
Installing app requirements for iPhone device... errored
*Unable to install requirements. This may be because one of your*
*requirements is invalid, or because pip was unable to connect*
*to the PyPI server.*
On Wed, Jan 22, 2025 at 4:53 PM Russell Keith-Magee < ***@***.***> wrote:
The issue here is likely the matplotlib version.
matplotlib contains a binary component, so it needs to be compiled;
BeeWare has published a pre-compiled version of the matplotlib wheels
<https://anaconda.org/beeware/matplotlib/files>, but we don't publish
*every* version of matplotlib. At present, 3.6.0 is the only version that
we publish. If you've pinned a different matplotlib version, then pip will
be trying to compile matplotlib, which won't work.
The other possibility is that one of matplotlib's dependencies (contourpy
in this case) has recently *become* a binary dependency. I know that
matplotlib 3.6.0 worked as recently as November, but I haven't tried since
then.
If you need to use a version other than 3.6.0, pip install doesn't have
enough context to be able to compile a binary wheel; you need to use a tool
like mobile-forge <https://github.com/beeware/mobile-forge> to build a
wheel. Mobile-forge *has* a matplotlib recipe... for 3.6.0; it should be
possible to update that recipe to a more recent version.
—
Reply to this email directly, view it on GitHub
<#2129 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A7IVDK544AIYHTQI7DNMBAT2MAHMPAVCNFSM6AAAAABVVWWDTOVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCOJSGIZDCNQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Thanks Russ, I can confirm ‘briefcase create ios’ works now. Up next, ‘briefcase build ios’ is failing, but this could be my own Xcode setup (first serious use of Xcode on this new-ish Mac). I’ll report back - thank you. Andy On Jan 23, 2025, at 9:33 PM, Russell Keith-Magee ***@***.***> wrote:
That's a variation of the same problem. It's trying to install contourpy, which has a binary package; matplotlib is specifying a requirement of >=1.0.1, it's deciding that 1.3.1 is the best fit (which is the most recent version), but that version is only available as a tarball, and it's trying to compile it.
As with matplotlib, we publish a binary build for iOS; and 1.0.5 is the most recent version we've published.
Briefcase should be preferring binary wheels over a source tarball. However, the binary wheel we've published is tagged ios_12_0, and the new support packages are based on iOS 13.0, so Briefcase is falling back to the tarball (and failing). The iOS version bump was introduced in Briefcase 0.3.20, as result of incorporating the offical iOS support that landed in CPython 3.13. I'm guessing the last time I built, I was using an older version of Briefcase, so I didn't see this problem.
Briefcase 0.3.21 (released a couple of hours ago) will at least identify the problem correctly, raising a different error:
INFO: pip is looking at multiple versions of matplotlib to determine which version is compatible with other requirements. This could take a while.
ERROR: Could not find a version that satisfies the requirement contourpy>=1.0.1 (from matplotlib) (from versions: none)
ERROR: No matching distribution found for contourpy>=1.0.1
Installing app requirements for iPhone device... errored
Unable to install requirements. This may be because one of your
requirements is invalid, or because pip was unable to connect
to the PyPI server.
The fix is for me to publish an ios_13_0 tagged version of contourpy (and also kiwisolver - another matplotlib dependency) - which I've just done. If you rebuild your app, Briefcase should find the binary wheels and complete the build.
Apologies for the confusion around this. The long term fix is for the Python ecosystem as a whole to start publishing iOS and Android wheels. I'm currently working on the tooling to make that a lot easier.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
OK, a little further now, but this is still pretty rough going. I've
cleaned and reinstalled xcode, including with iOS 18.2 platform support
confirmed present, and 'briefcase build ios' succeeds now. But the run
step doesn't work well at all.
When I do 'briefcase run ios', it prompts me for iOS version (18.1 or 18.2
available choices), then prompts for device to simulate (11 choices), and
brings up a simulator of appropriate size, shows the BeeWare bee icon
loading, then starts up my app. The first screen on my app is a password
entry screen (an input box, a password input box, and a couple buttons).
This renders and functions perfectly. Then when I successfully
authenticate, the next screen it wants to go to in my app is a pure canvas
screen, which is the first of five tabs in an OptionContainer which is
itself the top level toga container.
But this screen fails to render much of anything, and there's random junk
at the bottom of the simulator screen too. This is the behavior across all
combinations of ios and device that I chose (i tried many). The printouts
on the console confirm it's in the relevant function trying to draw my
canvas screen, but it's mostly empty, with random junk down bottom of the
screen. Hiidden behind the random junk are my option container tabs, which
I can barely see -- but if I click on one, it sometimes does a half-baked
render of the relevant screen, sometimes nothing.
Next I wondered if the issue was just the simulators, so I went to push it
onto my real iphone, and xcode comes back immediately (instantly) after I
click the triangle to try and start it (with my iPhone attached by cable,
and selected as the target device), with a message that just says "build
error" -- with no other diagnostic output I can see.
I was really hoping a simple, single-canvas screen would be the least of my
challenges, but I'm dead in my tracks again. And I apologize to burden the
BeeWare discussion board with my problems, but if anyone has a suggestion
of what might be going wrong, please let me know. My app works perfectly
on Mac and Windows.
Thanks,
Andy Maretz
…On Fri, Jan 24, 2025 at 5:38 AM Andy Maretz ***@***.***> wrote:
Thanks Russ, I can confirm ‘briefcase create ios’ works now. Up next,
‘briefcase build ios’ is failing, but this could be my own Xcode setup
(first serious use of Xcode on this new-ish Mac). I’ll report back - thank
you.
Andy
On Jan 23, 2025, at 9:33 PM, Russell Keith-Magee ***@***.***>
wrote:
That's a variation of the same problem. It's trying to install contourpy,
which has a binary package; matplotlib is specifying a requirement of
>=1.0.1, it's deciding that 1.3.1 is the best fit (which is the most
recent version), but that version is only available as a tarball, and it's
trying to compile it.
As with matplotlib, we publish a binary build for iOS
<https://anaconda.org/beeware/contourpy/files>; and 1.0.5 is the most
recent version we've published.
Briefcase *should* be preferring binary wheels over a source tarball.
However, the binary wheel we've published is tagged ios_12_0, and the new
support packages are based on iOS 13.0, so Briefcase is falling back to the
tarball (and failing). The iOS version bump was introduced in Briefcase
0.3.20, as result of incorporating the offical iOS support that landed in
CPython 3.13. I'm guessing the last time I built, I was using an older
version of Briefcase, so I didn't see this problem.
Briefcase 0.3.21 (released a couple of hours ago) will at least identify
the problem correctly, raising a different error:
INFO: pip is looking at multiple versions of matplotlib to determine which version is compatible with other requirements. This could take a while.
ERROR: Could not find a version that satisfies the requirement contourpy>=1.0.1 (from matplotlib) (from versions: none)
ERROR: No matching distribution found for contourpy>=1.0.1
Installing app requirements for iPhone device... errored
Unable to install requirements. This may be because one of your
requirements is invalid, or because pip was unable to connect
to the PyPI server.
The fix is for me to publish an ios_13_0 tagged version of contourpy (and
also kiwisolver - another matplotlib dependency) - which I've just done.
If you rebuild your app, Briefcase should find the binary wheels and
complete the build.
Apologies for the confusion around this. The long term fix is for the
Python ecosystem as a whole to start publishing iOS and Android wheels. I'm
currently working on the tooling to make that a lot easier.
—
Reply to this email directly, view it on GitHub
<#2129 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A7IVDK6T5MLAR7QF3ZM6J7D2MGRBDAVCNFSM6AAAAABVVWWDTOVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCOJTG42DEMA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
My app uses matplotlib for creating static images as temp png files (never direct display to UI). This is the matplotlib section of my imports, in which I believe the matplotlib.use('Agg') part is telling it not to touch the UI.
Everything works great on Mac and Windows, but 'briefcase create ios' fails, complaining about meson being unable to build contourpy, which if I understand right, is a matplotlib dependency not needed for static image generation.
Are other people able to build ios version of beeware app when using matplotlib, and do you have suggestion for how to overcome this build error. An excerpt of the 'briefcase create ios' output is below. Thank you.
Collecting contourpy>=1.0.1 (from matplotlib)
Using cached contourpy-1.3.1.tar.gz (13.5 MB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'error'
error: subprocess-exited-with-error
× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [14 lines of output]
+ meson setup /private/var/folders/k0/djm3lvm11_v6s0tsstgwylsh0000gn/T/pip-install-5fhi4bce/contourpy_88a671b600d0432ab59ffdc485621037 /private/var/folders/k0/djm3lvm11_v6s0tsstgwylsh0000gn/T/pip-install-5fhi4bce/contourpy_88a671b600d0432ab59ffdc485621037/.mesonpy-4edp1i73 -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --vsenv --native-file=/private/var/folders/k0/djm3lvm11_v6s0tsstgwylsh0000gn/T/pip-install-5fhi4bce/contourpy_88a671b600d0432ab59ffdc485621037/.mesonpy-4edp1i73/meson-python-native-file.ini
The Meson build system
Version: 1.6.1
Source dir: /private/var/folders/k0/djm3lvm11_v6s0tsstgwylsh0000gn/T/pip-install-5fhi4bce/contourpy_88a671b600d0432ab59ffdc485621037
Build dir: /private/var/folders/k0/djm3lvm11_v6s0tsstgwylsh0000gn/T/pip-install-5fhi4bce/contourpy_88a671b600d0432ab59ffdc485621037/.mesonpy-4edp1i73
Build type: native build
Project name: contourpy
Project version: 1.3.1
Beta Was this translation helpful? Give feedback.
All reactions