holzschu / a-Shell-commands

shell commands, pre-compiled to webAssembly, ready to use in a-Shell
599 stars 22 forks source link

Install scipy for python #60

Open jeromemargueron opened 3 days ago

jeromemargueron commented 3 days ago

I have tried installing scipy for python with the following command: python -m pip install scipy

But I got the following error:

Defaulting to user installation because normal site-packages is not writeable Collecting scipy Using cached scipy-1.14.1.tar.gz (58.6 MB) Preparing metadata (pyproject.toml) ... error error: subprocess-exited-with-error

× Preparing metadata (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [2 lines of output]

  ('\x1b[31m',)meson-python: error: Could not find meson version 0.63.3 or newer, found .
  [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.

I then tried to install meson: python -m pip install meson

And got this message:

Defaulting to user installation because normal site-packages is not writeable Requirement already satisfied: meson in /private/var/containers/Bundle/Application/774676DD-91B8-416E-8EFE-D5C8004C7BD5/a-Shell.app/Library/lib/python3.11/site-packages (1 .3.2)

I tried again to install scipy but I got the same error as before. Is there a solution?

holzschu commented 3 days ago

Hi,

Short answer: pip can only install pure Python packages in iOS apps. Scipy is not a pure Python package.

Long answer: keep in mind that iOS is a protected ecosystem: apps have to be inspected before they're allowed on the appStore, and they need to provide all executable content for the inspection (binaries, dynamic libraries, etc). It's impossible to add a binary to the app after it's been approved (because doing so would beat the purpose of the AppStore approval). When I say impossible, there's a double block: it's forbidden by the AppStore rules, and physically impossible (there are many locks in place to prevent you from doing it).

In the past 5-10 years, App developers have pushed that boundary: installing source code files is now allowed (as long as they are readable text), which is why you can use pip to install many packages. As long as they are pure Python packages. But Scipy is very much not a pure Python package: it has hundreds of dynamic libraries, written in C. So it can only be installed at the App level.

Right now, there is Carnets-with-Scipy that has scipy (and a lot of packages that depend on it, like sklearn and seaborn). The next major upgrade to a-Shell will include Python 3.13 and scipy. I just hope it won't make the app too large.

jeromemargueron commented 3 days ago

Thank you for your answer to my question and for your time explaining me the issue which is faced with scipy.I am currently developing a python toolkit for a scientific community. In addition to the standard use with pc or mac, I wanted to write notes explaiing how to use the toolkit on various other plateforms, in particuliar with an iPad. I was thinking about a-shell because it is simple to use. I am also investigating how to run it with carnets that I have installed already. I would also like to thank you for the development of these emulators which are great!I will wait the next release of a-shell and add notes once I will have tested it.I am not using many python librairies and I will also investigate if it is possible to replace scipy by other python packages existing on a-shell. But it takes some time…Best regards,Jérôme MargueronLe 21 nov. 2024 à 23:11, Nicolas Holzschuch @.***> a écrit : Hi, Short answer: pip can only install pure Python packages in iOS apps. Scipy is not a pure Python package. Long answer: keep in mind that iOS is a protected ecosystem: apps have to be inspected before they're allowed on the appStore, and they need to provide all executable content for the inspection (binaries, dynamic libraries, etc). It's impossible to add a binary to the app after it's been approved (because doing so would beat the purpose of the AppStore approval). When I say impossible, there's a double block: it's forbidden by the AppStore rules, and physically impossible (there are many locks in place to prevent you from doing it). In the past 5-10 years, App developers have pushed that boundary: installing source code files is now allowed (as long as they are readable text), which is why you can use pip to install many packages. As long as they are pure Python packages. But Scipy is very much not a pure Python package: it has hundreds of dynamic libraries, written in C. So it can only be installed at the App level. Right now, there is Carnets-with-Scipy that has scipy (and a lot of packages that depend on it, like sklearn and seaborn). The next major upgrade to a-Shell will include Python 3.13 and scipy. I just hope it won't make the app too large.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>