-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scipy is not installed due to "Error: 'numpy' must be installed before running the build." #2509
Comments
this patch: 7f4652a adds scipy support, and also updates numpy recipe with |
Thanks for the reply. Would you please let me know how should I check if this works or not in my ENV. |
I found if I remove scipy from the requirements of p4a command and the command as below, the numpy can be successfully built and installed into site-packages. I can see the directory: But once I add scipy in the end, the numpy is missing from the site-packages So it looks like an issue of scipy but I'm not sure. |
try checking out p4a at 7f4652a and see if it works there. |
Thanks for the help, with this patch, seems things got different than before. While I searched in my ENV, it's should be there: Any suggestion for how to move forward, appreciate for the help.
|
when building for 32bit, you need to check out p4a to fe5c909 |
Thanks for the help, after I checkout this patch, I successfully built app twice but the app is not running on android for reason that some library in psutil is not for arm. Seems it complains about 'threads.h' cannot be find on my ENV while building scipy, I searched on my ENV, there's indeed no such file. Does it mean there's some file missing in my android SDK? Sorry to bother you time and time again.
kivy@kivy-virtual-machine:/$ sudo find / -name unwind.h
/home/kivy/.local/share/python-for-android/build/other_builds/hostpython3/desktop/hostpython3/native-build/Lib/site-packages/numpy/core/include/numpy/npy_common.h:210:23: note: ########### EXT COMPILER OPTIMIZATION ########### CPU baseline : CPU dispatch : ########### CLIB COMPILER OPTIMIZATION ########### CPU baseline : CPU dispatch : |
I tried to copy threads.h as follows:
build/src.linux-x86_64-3.8/scipy/integrate/vodemodule.c:618:12: error: use of undeclared identifier '_active_cb_jac_in_dvode__user__routines'; did you mean 'get_active_cb_jac_in_dvode__user__routines'? |
Besides my last comment, I missed another error for building lapack, it cannot find cblas.h.
|
As per comment here: make sure you have latest cmake. Patches were tested using NDK r19c, and target API 28. |
I'm using r19b, not sure if that the difference is causing the problem on my side. |
I've tried it too and I'm getting the same error.Case1) p4a master, ndk version 19c + gfortran, target api 27, cmake version 3.16.3, OS Ubuntu 20.04, target CPU=armeabi-v7a
FAILURE: Build failed with an exception.
Case3) p4a master, ndk version 19c + gfortran, target api 27, cmake version 3.16.3, OS Ubuntu 20.04, target CPU=arm64-v8a
FAILURE: Build failed with an exception.
Since the compilation of Scipy has been successful, I think that if you put the compiled Scipy at the top of the project and modify the include relation of buildozer.spec, you can create apk or aab of one CPU. I haven't tried it yet. |
Please try building lapack/scipy in the latest develop branch, #2615 is introduced to solve build issues with latest changes in p4a. |
Fixed via #2615. Feel free to re-open if the issue still persists. |
Checklist
p4a.branch = develop
)Versions
kivy@kivy-virtual-machine:~/work/project/biga_futures/package$ p4a --version
2021.09.05
Description
Scipy is pending on numpy as I saw scipy recipe below:
It's failed been installed for error below, more logs see Logs section.
"Error: 'numpy' must be installed before running the build."
buildozer.spec
Command:
p4a apk --private $HOME/work/project/biga_futures/ --package=org.kivy.biga_futures --name "biga_futures" --version 0.1 --bootstrap=sdl2 --requirements=python3,kivy,pandas,typing_extensions,chardet,requests,urllib3,psutil,jwt,cryptography,numpy,scipy --permission PERMISSIONS INTERNET
No matter numpy is in the '--requirements' or not, nothing different.
Spec file:
Logs
[INFO]: pandas said it is already built, skipping
[INFO]: Building scipy for armeabi-v7a
[INFO]: scipy apparently isn't already in site-packages
[INFO]: Building compiled components in scipy
[INFO]: -> directory context /home/kivy/.local/share/python-for-android/build/other_builds/scipy/armeabi-v7a__ndk_target_21/scipy
[INFO]: -> running python3 setup.py build_ext -v -j 1
working: Error: 'numpy' must be installed before running the build. Exception in thread background thread for pid 1206223:
Traceback (most recent call last):
File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/usr/lib/python3.8/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "/home/kivy/.local/lib/python3.8/site-packages/sh.py", line 1683, in wrap
fn(*rgs, **kwargs)
File "/home/kivy/.local/lib/python3.8/site-packages/sh.py", line 2662, in background_thread
handle_exit_code(exit_code)
File "/home/kivy/.local/lib/python3.8/site-packages/sh.py", line 2349, in fn
return self.command.handle_command_exit_code(exit_code)
File "/home/kivy/.local/lib/python3.8/site-packages/sh.py", line 905, in handle_command_exit_code
raise exc
sh.ErrorReturnCode_1:
RAN: /home/kivy/.local/share/python-for-android/build/other_builds/hostpython3/desktop/hostpython3/native-build/python3 setup.py build_ext -v -j 1
STDOUT:
Error: 'numpy' must be installed before running the build.
STDERR:
Traceback (most recent call last):
File "/home/kivy/.local/bin/p4a", line 8, in
sys.exit(main())
File "/home/kivy/.local/lib/python3.8/site-packages/pythonforandroid/entrypoints.py", line 18, in main
ToolchainCL()
File "/home/kivy/.local/lib/python3.8/site-packages/pythonforandroid/toolchain.py", line 725, in init
getattr(self, command)(args)
File "/home/kivy/.local/lib/python3.8/site-packages/pythonforandroid/toolchain.py", line 153, in wrapper_func
build_dist_from_args(ctx, dist, args)
File "/home/kivy/.local/lib/python3.8/site-packages/pythonforandroid/toolchain.py", line 212, in build_dist_from_args
build_recipes(build_order, python_modules, ctx,
File "/home/kivy/.local/lib/python3.8/site-packages/pythonforandroid/build.py", line 580, in build_recipes
recipe.build_arch(arch)
File "/home/kivy/.local/lib/python3.8/site-packages/pythonforandroid/recipe.py", line 1011, in build_arch
self.build_compiled_components(arch)
File "/home/kivy/.local/lib/python3.8/site-packages/pythonforandroid/recipes/scipy/init.py", line 16, in build_compiled_components
super().build_compiled_components(arch)
File "/home/kivy/.local/lib/python3.8/site-packages/pythonforandroid/recipe.py", line 1022, in build_compiled_components
shprint(hostpython, 'setup.py', self.build_cmd, '-v',
File "/home/kivy/.local/lib/python3.8/site-packages/pythonforandroid/logger.py", line 167, in shprint
for line in output:
File "/home/kivy/.local/lib/python3.8/site-packages/sh.py", line 953, in next
self.wait()
File "/home/kivy/.local/lib/python3.8/site-packages/sh.py", line 879, in wait
self.handle_command_exit_code(exit_code)
File "/home/kivy/.local/lib/python3.8/site-packages/sh.py", line 905, in handle_command_exit_code
raise exc
sh.ErrorReturnCode_1:
RAN: /home/kivy/.local/share/python-for-android/build/other_builds/hostpython3/desktop/hostpython3/native-build/python3 setup.py build_ext -v -j 1
STDOUT:
Error: 'numpy' must be installed before running the build.
The text was updated successfully, but these errors were encountered: