holzschu / a-Shell-commands

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

Can I install spaCy? #18

Closed system1system2 closed 3 years ago

system1system2 commented 3 years ago

I’m trying to install spaCy but I’m failing. The instructions are:

pip install -U pip setuptools wheel pip install -U spacy python -m spacy download en_core_web_sm

The installation of wheel works fine. The second step creates the following error:

$ pip3 install spacy
Defaulting to user installation because normal site-packages is not writeable
Collecting spacy
Using cached spacy-3.1.4.tar.gz (1.0 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
ERROR: Command errored out with exit status 1:
command: /private/var/containers/Bundle/Application/0C3FC5C3-CD59-44E2-B839-96DB56A42B1C/a-Shell.app/Library/bin/python3/var/mobile/Containers/Data/Application/4873B6C
1-48F3-4504-8E5E-A92AD8260737/Library/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build _wheel /private/var/mobile/Containers/
Data/Application/4873B6C1-48F3-4504-8E5E-A92AD8260737/tmp/tmpjOu8hwgw
cwd: /private/var/mobile/Containers/Data/Application/4873B6C1-48F3-4504-8E5E-A92AD8260737/tmp/pip-install-q y2s6a5/spacy_bd93af1c48374ea591fcdc216645a0ae
Complete output (16 lines):
Traceback (most recent call last) :
File "/var/mobile/Containers/Data/Application/4873B6C1-48F3-4504-8E5E-A92AD8260737/Library/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py",l
ine 363, in module>
main()
File "/var/mobile/Containers/Data/Application/4873B6C1-48F3-4504-8E5E-A92AD8260737/Library/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py",1
ine 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/var/mobile/Containers/Data/Application/4873B6C1-48F3-4504-8E5E-A92AD8260737/Library/lib/python3.9/site-packages/pip/_vendor/pep517/in process/_in process.py",
ine 130, in get_requires_for_build wheel
return hook(config_settings)
File "/private/var/mobile/Containers/Data/Application/4873B6C1-48F3-4504-8E5E-A92AD8260737/tmp/pip-build-env-aohb1555/overlay/lib/python3.9/site-packages/setuptools/bu
ild_meta.py", line 154, in get_requires_for_build wheel
return self._get_build_requires
File "/private/var/mobile/Containers/Data/Application/4873B6C1-48F3-4504-8E5E-A92AD8260737/tmp/pip-build-env-aohb1555/overlay/lib/python3.9/site-packages/setuptools/bu
ild _meta.py", line 135, in _get_build_requires
self.run_setup()
File "/private/var/mobile/Containers/Data/Application/4873B6C1-48F3-4504-8E5E-A92AD8260737/tmp/pip-build-env-aohb1555/overlay/lib/python3.9/site-packages/setuptools/bu
ild meta.py", line 150, in run_setup
exec (compile(code,
file_
"exec'), locals ())
File "setup. py",
line 5, in <module>
import numpy
ModuleNotFoundError: No module named
"numpy
WARNING: Discarding https://files.pythonhosted.org/packages/e4/a9/9628234a2e4892919c3c807de6759097ac0d525391d18df1d98da0512e77/spacy-3.1.4.tar.gz#sha256=327664307445f095cf
72960cf3559ee7ca6af42185ec977cec59f0765df05636 (from https://pypi.org/simple/spacy/ (requires-python:>=3.6). Command errored out with exit status 1: /private/var/containe
rs/Bundle/Application/OC3FC5C3-CD59-44E2-B839-96DB56A42B1C/a-Shell.app/Library/bin/python3/var/mobile/Containers/Data/Application/4873B6C1-48F3-4504-8E5E-A92AD8260737/Lib
rary/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.pyget_requires_for_build_wheel/private/var/mobile/Containers/Data/Application/4873B6C1-48F3-45
04-8E5E-A92AD8260737/tmp/tmpj0u8hwqw Check the logs for full command output.
Using cached spacy-3.1.3.tar.gz (1.0 MB)
Installing build dependencies ...
canceled
ERROR: Operation cancelled by user

Any help would be appreciated. Thank you.

2735671D-F097-497D-A638-D0FC76DB8B7F

holzschu commented 3 years ago

The first clue is that the error occurs in a file named "build_meta.py", in a function named "_get_build_requires": pip is trying to compile a Cython module, and checks the presence of a compiler.

Looking at Spacy source code, they have multiple modules written in Cython, and thus cannot be installed by the user (there are no compilers available on iOS).

system1system2 commented 3 years ago

What a shame.

Thanks for the blazing fast answer.