@Chris-Stratton Right, without specifying the include flags I get an error about Python.h
not being found and it's nowhere in the staging directory.
Gabriel Gabor
@Gabriel Gabor
Best posts made by Gabriel Gabor
Latest posts made by Gabriel Gabor
-
RE: Cross-compile python packge
-
RE: Cross-compile python packge
Running
mipsel-openwrt-linux-musl-gcc -dM -E - < /dev/null
to get the predefined macros explains this error
/usr/include/python2.7/pyconfig.h:83:5: error: #error unknown multiarch location for pyconfig.h # error unknown multiarch location for pyconfig.h
but I'm unsure about what I could do about it. It looks more like an uncovered case.
-
Cross-compile python packge
Hi, I'm trying to get the Alexa-Pi client to run on the Omega2+.
In the dependencies of the project, there's pyaudio which throws some errors related to
'mipsel-openwrt-linux-musl-gcc': No such file or directory
when I try to install it using pip. After reading pars of the documentation I found out that the only way I could do this is by cross-compiling the c code from the package. So I got a Debian 9 instance running, built the source, cloned the pyaudio code and tried to compile but I get a lot of errors which I have not been able to solve yet.$ /home/admin/source/staging_dir/toolchain-mipsel_24kc_gcc-5.4.0_musl/bin/mipsel-openwrt-linux-musl-gcc -I /usr/include/ -I /usr/include/python2.7/ src/_portaudiomodule.c In file included from /usr/include/libio.h:31:0, from /usr/include/stdio.h:74, from src/_portaudiomodule.c:27: /usr/include/_G_config.h:46:20: error: unknown type name '__gnuc_va_list' #define _G_va_list __gnuc_va_list ^ /usr/include/libio.h:44:21: note: in expansion of macro '_G_va_list' #define _IO_va_list _G_va_list ^ /usr/include/libio.h:460:4: note: in expansion of macro '_IO_va_list' _IO_va_list, int *__restrict); ^ /usr/include/_G_config.h:46:20: error: unknown type name '__gnuc_va_list' #define _G_va_list __gnuc_va_list ^ /usr/include/libio.h:44:21: note: in expansion of macro '_G_va_list' #define _IO_va_list _G_va_list ^ /usr/include/libio.h:462:5: note: in expansion of macro '_IO_va_list' _IO_va_list); ^ /usr/include/_G_config.h:46:20: error: unknown type name '__gnuc_va_list' #define _G_va_list __gnuc_va_list ^ /usr/include/stdio.h:79:9: note: in expansion of macro '_G_va_list' typedef _G_va_list va_list; ^ In file included from src/_portaudiomodule.c:27:0: /usr/include/stdio.h:79:20: error: conflicting types for 'va_list' typedef _G_va_list va_list; ^ In file included from /home/admin/source/staging_dir/toolchain-mipsel_24kc_gcc-5.4.0_musl/include/stdarg.h:10:0, from /usr/include/libio.h:49, from /usr/include/stdio.h:74, from src/_portaudiomodule.c:27: /home/admin/source/staging_dir/toolchain-mipsel_24kc_gcc-5.4.0_musl/include/bits/alltypes.h:6:27: note: previous declaration of 'va_list' was here typedef __builtin_va_list va_list; ^ In file included from /usr/include/libio.h:31:0, from /usr/include/stdio.h:74, from src/_portaudiomodule.c:27: /usr/include/_G_config.h:46:20: error: unknown type name '__gnuc_va_list' #define _G_va_list __gnuc_va_list ^ /usr/include/stdio.h:374:8: note: in expansion of macro '_G_va_list' _G_va_list __arg); ^ /usr/include/_G_config.h:46:20: error: unknown type name '__gnuc_va_list' #define _G_va_list __gnuc_va_list ^ /usr/include/stdio.h:379:54: note: in expansion of macro '_G_va_list' extern int vprintf (const char *__restrict __format, _G_va_list __arg); ^ /usr/include/_G_config.h:46:20: error: unknown type name '__gnuc_va_list' #define _G_va_list __gnuc_va_list ^ /usr/include/stdio.h:382:8: note: in expansion of macro '_G_va_list' _G_va_list __arg) __THROWNL; ^ /usr/include/_G_config.h:46:20: error: unknown type name '__gnuc_va_list' #define _G_va_list __gnuc_va_list ^ /usr/include/stdio.h:393:42: note: in expansion of macro '_G_va_list' const char *__restrict __format, _G_va_list __arg) ^ /usr/include/_G_config.h:46:20: error: unknown type name '__gnuc_va_list' #define _G_va_list __gnuc_va_list ^ /usr/include/stdio.h:415:8: note: in expansion of macro '_G_va_list' _G_va_list __arg) ^ /usr/include/_G_config.h:46:20: error: unknown type name '__gnuc_va_list' #define _G_va_list __gnuc_va_list ^ /usr/include/stdio.h:474:7: note: in expansion of macro '_G_va_list' _G_va_list __arg) ^ /usr/include/_G_config.h:46:20: error: unknown type name '__gnuc_va_list' #define _G_va_list __gnuc_va_list ^ /usr/include/stdio.h:481:53: note: in expansion of macro '_G_va_list' extern int vscanf (const char *__restrict __format, _G_va_list __arg) ^ /usr/include/_G_config.h:46:20: error: unknown type name '__gnuc_va_list' #define _G_va_list __gnuc_va_list ^ /usr/include/stdio.h:486:40: note: in expansion of macro '_G_va_list' const char *__restrict __format, _G_va_list __arg) ^ In file included from /usr/include/features.h:364:0, from /usr/include/stdio.h:27, from src/_portaudiomodule.c:27: /usr/include/_G_config.h:46:20: error: unknown type name '__gnuc_va_list' #define _G_va_list __gnuc_va_list ^ /usr/include/sys/cdefs.h:177:46: note: in definition of macro '__REDIRECT' # define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias)) ^ /usr/include/stdio.h:498:37: note: in expansion of macro '_G_va_list' const char *__restrict __format, _G_va_list __arg), ^ /usr/include/_G_config.h:46:20: error: unknown type name '__gnuc_va_list' #define _G_va_list __gnuc_va_list ^ /usr/include/sys/cdefs.h:177:46: note: in definition of macro '__REDIRECT' # define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias)) ^ /usr/include/stdio.h:502:5: note: in expansion of macro '_G_va_list' _G_va_list __arg), __isoc99_vscanf) ^ /usr/include/_G_config.h:46:20: error: unknown type name '__gnuc_va_list' #define _G_va_list __gnuc_va_list ^ /usr/include/sys/cdefs.h:185:11: note: in definition of macro '__REDIRECT_NTH' name proto __asm__ (__ASMNAME (#alias)) __THROW ^ /usr/include/stdio.h:507:8: note: in expansion of macro '_G_va_list' _G_va_list __arg), __isoc99_vsscanf) ^ In file included from /usr/include/python2.7/Python.h:8:0, from src/_portaudiomodule.c:28: /usr/include/python2.7/pyconfig.h:83:5: error: #error unknown multiarch location for pyconfig.h # error unknown multiarch location for pyconfig.h ^ In file included from /usr/include/bits/local_lim.h:38:0, from /usr/include/bits/posix1_lim.h:160, from /usr/include/limits.h:143, from /usr/include/python2.7/Python.h:19, from src/_portaudiomodule.c:28: /usr/include/linux/limits.h:6:0: warning: "NGROUPS_MAX" redefined #define NGROUPS_MAX 65536 /* supplemental group IDs are available */ ^ In file included from /usr/include/limits.h:123:0, from /usr/include/python2.7/Python.h:19, from src/_portaudiomodule.c:28: /home/admin/source/staging_dir/toolchain-mipsel_24kc_gcc-5.4.0_musl/include/limits.h:51:0: note: this is the location of the previous definition #define NGROUPS_MAX 32 ^ In file included from /usr/include/bits/posix1_lim.h:160:0, from /usr/include/limits.h:143, from /usr/include/python2.7/Python.h:19, from src/_portaudiomodule.c:28: /usr/include/bits/local_lim.h:64:0: warning: "PTHREAD_KEYS_MAX" redefined #define PTHREAD_KEYS_MAX 1024 ^ In file included from /usr/include/limits.h:123:0, from /usr/include/python2.7/Python.h:19, from src/_portaudiomodule.c:28: /home/admin/source/staging_dir/toolchain-mipsel_24kc_gcc-5.4.0_musl/include/limits.h:63:0: note: this is the location of the previous definition #define PTHREAD_KEYS_MAX 128 ^ In file included from /usr/include/bits/posix1_lim.h:160:0, from /usr/include/limits.h:143, from /usr/include/python2.7/Python.h:19, from src/_portaudiomodule.c:28: /usr/include/bits/local_lim.h:69:0: warning: "PTHREAD_DESTRUCTOR_ITERATIONS" redefined #define PTHREAD_DESTRUCTOR_ITERATIONS _POSIX_THREAD_DESTRUCTOR_ITERATIONS ^ In file included from /usr/include/limits.h:123:0, from /usr/include/python2.7/Python.h:19, from src/_portaudiomodule.c:28: /home/admin/source/staging_dir/toolchain-mipsel_24kc_gcc-5.4.0_musl/include/limits.h:65:0: note: this is the location of the previous definition #define PTHREAD_DESTRUCTOR_ITERATIONS 4 ^ In file included from /usr/include/bits/posix1_lim.h:160:0, from /usr/include/limits.h:143, from /usr/include/python2.7/Python.h:19, from src/_portaudiomodule.c:28: /usr/include/bits/local_lim.h:81:0: warning: "PTHREAD_STACK_MIN" redefined #define PTHREAD_STACK_MIN 16384 ^ In file included from /usr/include/limits.h:123:0, from /usr/include/python2.7/Python.h:19, from src/_portaudiomodule.c:28: /home/admin/source/staging_dir/toolchain-mipsel_24kc_gcc-5.4.0_musl/include/limits.h:64:0: note: this is the location of the previous definition #define PTHREAD_STACK_MIN 2048 ^ In file included from /usr/include/bits/posix1_lim.h:160:0, from /usr/include/limits.h:143, from /usr/include/python2.7/Python.h:19, from src/_portaudiomodule.c:28: /usr/include/bits/local_lim.h:84:0: warning: "DELAYTIMER_MAX" redefined #define DELAYTIMER_MAX 2147483647 ^ In file included from /usr/include/limits.h:123:0, from /usr/include/python2.7/Python.h:19, from src/_portaudiomodule.c:28: /home/admin/source/staging_dir/toolchain-mipsel_24kc_gcc-5.4.0_musl/include/limits.h:68:0: note: this is the location of the previous definition #define DELAYTIMER_MAX 0x7fffffff ^ In file included from /usr/include/bits/posix1_lim.h:160:0, from /usr/include/limits.h:143, from /usr/include/python2.7/Python.h:19, from src/_portaudiomodule.c:28: /usr/include/bits/local_lim.h:93:0: warning: "HOST_NAME_MAX" redefined #define HOST_NAME_MAX 64 ^ In file included from /usr/include/limits.h:123:0, from /usr/include/python2.7/Python.h:19, from src/_portaudiomodule.c:28: /home/admin/source/staging_dir/toolchain-mipsel_24kc_gcc-5.4.0_musl/include/limits.h:59:0: note: this is the location of the previous definition #define HOST_NAME_MAX 255 ^ In file included from /usr/include/bits/posix1_lim.h:160:0, from /usr/include/limits.h:143, from /usr/include/python2.7/Python.h:19, from src/_portaudiomodule.c:28: /usr/include/bits/local_lim.h:99:0: warning: "SEM_VALUE_MAX" redefined #define SEM_VALUE_MAX (2147483647) ^ In file included from /usr/include/limits.h:123:0, from /usr/include/python2.7/Python.h:19, from src/_portaudiomodule.c:28: /home/admin/source/staging_dir/toolchain-mipsel_24kc_gcc-5.4.0_musl/include/limits.h:66:0: note: this is the location of the previous definition #define SEM_VALUE_MAX 0x7fffffff ^ In file included from /usr/include/limits.h:147:0, from /usr/include/python2.7/Python.h:19, from src/_portaudiomodule.c:28: /usr/include/bits/posix2_lim.h:88:0: warning: "RE_DUP_MAX" redefined #define RE_DUP_MAX (0x7fff) ^ In file included from /usr/include/limits.h:123:0, from /usr/include/python2.7/Python.h:19, from src/_portaudiomodule.c:28: /home/admin/source/staging_dir/toolchain-mipsel_24kc_gcc-5.4.0_musl/include/limits.h:82:0: note: this is the location of the previous definition #define RE_DUP_MAX 255 ^ In file included from /usr/include/python2.7/pyport.h:4:0, from /usr/include/python2.7/Python.h:58, from src/_portaudiomodule.c:28: /usr/include/python2.7/pyconfig.h:83:5: error: #error unknown multiarch location for pyconfig.h # error unknown multiarch location for pyconfig.h ^ In file included from /usr/include/python2.7/Python.h:58:0, from src/_portaudiomodule.c:28: /usr/include/python2.7/pyport.h:895:2: error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)." #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)." ^ In file included from /usr/include/python2.7/pymath.h:4:0, from /usr/include/python2.7/Python.h:77, from src/_portaudiomodule.c:28: /usr/include/python2.7/pyconfig.h:83:5: error: #error unknown multiarch location for pyconfig.h # error unknown multiarch location for pyconfig.h ^ src/_portaudiomodule.c: In function '_pyAudio_paHostApiInfo_get_name': src/_portaudiomodule.c:509:10: warning: implicit declaration of function 'PyUnicode_FromString' [-Wimplicit-function-declaration] return PyUnicode_FromString(self->apiInfo->name); ^ src/_portaudiomodule.c:509:10: warning: return makes pointer from integer without a cast [-Wint-conversion] src/_portaudiomodule.c: In function 'pa_get_version_text': src/_portaudiomodule.c:1196:10: warning: return makes pointer from integer without a cast [-Wint-conversion] return PyUnicode_FromString(Pa_GetVersionText()); ^ src/_portaudiomodule.c: In function 'init_portaudio': src/_portaudiomodule.c:2594:3: warning: implicit declaration of function 'PyEval_InitThreads' [-Wimplicit-function-declaration] PyEval_InitThreads(); ^
P.S. This is the first time I try to cross-compile, my approach could be completely wrong.
-
RE: Can't install python package with pip
Hi, I used to get a similar error when I tried to install pip & virtualenv for python2, I got it to work by booting from a USB stick (https://docs.onion.io/omega2-docs/boot-from-external-storage.html). I just tried your steps now on my Omega and it worked fine.
root@Omega-46A5:~# pip3 install requests Collecting requests Using cached requests-2.18.4-py2.py3-none-any.whl Collecting urllib3<1.23,>=1.21.1 (from requests) Using cached urllib3-1.22-py2.py3-none-any.whl Collecting idna<2.7,>=2.5 (from requests) Using cached idna-2.6-py2.py3-none-any.whl Collecting chardet<3.1.0,>=3.0.2 (from requests) Using cached chardet-3.0.4-py2.py3-none-any.whl Collecting certifi>=2017.4.17 (from requests) Using cached certifi-2017.7.27.1-py2.py3-none-any.whl Installing collected packages: urllib3, idna, chardet, certifi, requests Successfully installed certifi-2017.7.27.1 chardet-3.0.4 idna-2.6 requests-2.18.4 urllib3-1.22 root@Omega-46A5:~# python3 Python 3.6.0 (default, Sep 18 2017, 20:34:00) [GCC 5.4.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import requests >>>