Skip to content
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

[Python py project unable to build wheel]: #20039

Open
LmTechyTEM opened this issue May 6, 2024 · 18 comments · May be fixed by #20246
Open

[Python py project unable to build wheel]: #20039

LmTechyTEM opened this issue May 6, 2024 · 18 comments · May be fixed by #20246
Labels
bug report Something is not working properly.

Comments

@LmTechyTEM
Copy link

Problem description

I've been having problems with installing python packages that are are py project toml based, regular packages work fine. Here's the error

copying aiohttp/_helpers.pyx -> build/lib.linux-aarch64-cpython-311/aiohttp
      copying aiohttp/_http_parser.pyx -> build/lib.linux-aarch64-cpython-311/aiohttp
      copying aiohttp/_http_writer.pyx -> build/lib.linux-aarch64-cpython-311/aiohttp
      copying aiohttp/_websocket.pyx -> build/lib.linux-aarch64-cpython-311/aiohttp
      copying aiohttp/py.typed -> build/lib.linux-aarch64-cpython-311/aiohttp
      creating build/lib.linux-aarch64-cpython-311/aiohttp/.hash
      copying aiohttp/.hash/_cparser.pxd.hash -> build/lib.linux-aarch64-cpython-311/aiohttp/.hash
      copying aiohttp/.hash/_find_header.pxd.hash -> build/lib.linux-aarch64-cpython-311/aiohttp/.hash
      copying aiohttp/.hash/_helpers.pyi.hash -> build/lib.linux-aarch64-cpython-311/aiohttp/.hash
      copying aiohttp/.hash/_helpers.pyx.hash -> build/lib.linux-aarch64-cpython-311/aiohttp/.hash
      copying aiohttp/.hash/_http_parser.pyx.hash -> build/lib.linux-aarch64-cpython-311/aiohttp/.hash
      copying aiohttp/.hash/_http_writer.pyx.hash -> build/lib.linux-aarch64-cpython-311/aiohttp/.hash
      copying aiohttp/.hash/_websocket.pyx.hash -> build/lib.linux-aarch64-cpython-311/aiohttp/.hash
      copying aiohttp/.hash/hdrs.py.hash -> build/lib.linux-aarch64-cpython-311/aiohttp/.hash
      running build_ext
      building 'aiohttp._websocket' extension
      creating build/temp.linux-aarch64-cpython-311
      creating build/temp.linux-aarch64-cpython-311/aiohttp
      aarch64-linux-android-clang -DNDEBUG -g -fwrapv -O3 -Wall -fstack-protector-strong -O3 -fstack-protector-strong -O3 -fPIC -I/data/data/com.termux/files/usr/include/python3.11 -c aiohttp/_websocket.c -o build/temp.linux-aarch64-cpython-311/aiohttp/_websocket.o
      aarch64-linux-android-clang -shared -L/data/data/com.termux/files/usr/lib -Wl,-rpath=/data/data/com.termux/files/usr/lib -fopenmp -static-openmp -fno-openmp-implicit-rpath -Wl,--enable-new-dtags -Wl,--as-needed -Wl,-z,relro,-z,now -Wl,--no-as-needed,-landroid-support,--as-needed -L/home/builder/.termux-build/_cache/android-r26b-api-24-v3/sysroot/usr/lib -L/data/data/com.termux/files/usr/lib -Wl,-rpath=/data/data/com.termux/files/usr/lib -fopenmp -static-openmp -fno-openmp-implicit-rpath -Wl,--enable-new-dtags -Wl,--as-needed -Wl,-z,relro,-z,now -Wl,--no-as-needed,-landroid-support,--as-needed -L/home/builder/.termux-build/_cache/android-r26b-api-24-v3/sysroot/usr/lib build/temp.linux-aarch64-cpython-311/aiohttp/_websocket.o -L/data/data/com.termux/files/usr/lib -lpython3.11 -o build/lib.linux-aarch64-cpython-311/aiohttp/_websocket.cpython-311.so
      aarch64-linux-android-clang: error: unknown argument: '-fno-openmp-implicit-rpath'
      aarch64-linux-android-clang: error: unknown argument: '-fno-openmp-implicit-rpath'
      error: command '/data/data/com.termux/files/usr/bin/aarch64-linux-android-clang' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for aiohttp
Failed to build Pillow aiohttp
ERROR: Could not build wheels for Pillow, aiohttp, which is required to install pyproject.toml-based projects

 itsCyberToast  termux  ~ 

What steps will reproduce the bug?

Install python
Install any py project toml example: aiohttp, pillow

What is the expected behavior?

It's supposed to install normally but it does this.

System information

termux-info:

Termux Variables:
TERMUX_API_VERSION=0.50.1
TERMUX_APK_RELEASE=GITHUB
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP_PID=9174
TERMUX_IS_DEBUGGABLE_BUILD=1
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.0
TERMUX__USER_ID=0
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://packages.termux.org/apt/termux-main stable main
# tur-repo (sources.list.d/tur.list)
deb https://tur.kcubeterm.com tur-packages tur tur-on-device tur-continuous
# x11-repo (sources.list.d/x11.list)
deb https://packages-cf.termux.dev/apt/termux-x11/ x11 main
Updatable packages:
All packages up to date
termux-tools version:
1.42.0
Android version:
14
Kernel build information:
Linux localhost 4.19.191-27944104-abA146USQS6CXC2 #1 SMP PREEMPT Fri Mar 8 17:06:37 KST 2024 aarch64 Android
Device manufacturer:
samsung
Device model:
SM-A146U
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
Installed termux plugins:
com.termux.x11 versionCode:14
com.termux.api versionCode:51
@LmTechyTEM LmTechyTEM added bug report Something is not working properly. untriaged labels May 6, 2024
@Biswa96
Copy link
Contributor

Biswa96 commented May 6, 2024

I can reproduce the same error with pip install aiohttp command. The clang 17.0.2 in NDK supports -fopenmp-implicit-rpath option but clang 18.1.5 in termux-packages does not support that.

@licy183 licy183 removed the untriaged label May 6, 2024
@licy183
Copy link
Member

licy183 commented May 6, 2024

This issue will be difficult to fix in the builder side until next NDK ships.

A possible way is modifying $PREFIX/lib/python3.11/_sysconfigdata*.py manually.

_file="$(find $PREFIX/lib/python3.11 -name "_sysconfigdata*.py")"
rm -rf $PREFIX/lib/python3.11/__pycache__
cp $_file "$_file".backup
sed -i 's|-fno-openmp-implicit-rpath||g' "$_file"

Related: #19766

Edit:
[1] Replace TERMUX_PREFIX with PREFIX.

@davidtompul-tvlk
Copy link

This issue will be difficult to fix in the builder side until next NDK ships.

A possible way is modifying $PREFIX/lib/python3.11/_sysconfigdata*.py manually.

_file="$(find $TERMUX_PREFIX/lib/python3.11 -name "_sysconfigdata*.py")"
rm -rf $PREFIX/lib/python3.11/__pycache__
cp $_file "$_file".backup
sed -i 's|-fno-openmp-implicit-rpath||g' "$_file"

Related: #19766

Hi i can not access the lib, any solution for this??

~ $ which python3
/data/data/com.termux/files/usr/bin/python3
~ $ _file="$(find $TERMUX_PREFIX/lib/python3.11 -name "_sysconfigdata*.py")"find: ‘/data/data/com.termux/files/lib/python3.11’: No such file or directory

@Vladik01-11
Copy link

Vladik01-11 commented May 12, 2024

This issue will be difficult to fix in the builder side until next NDK ships.
A possible way is modifying $PREFIX/lib/python3.11/_sysconfigdata*.py manually.

_file="$(find $TERMUX_PREFIX/lib/python3.11 -name "_sysconfigdata*.py")"
rm -rf $PREFIX/lib/python3.11/__pycache__
cp $_file "$_file".backup
sed -i 's|-fno-openmp-implicit-rpath||g' "$_file"

Related: #19766

Hi i can not access the lib, any solution for this??

~ $ which python3
/data/data/com.termux/files/usr/bin/python3
~ $ _file="$(find $TERMUX_PREFIX/lib/python3.11 -name "_sysconfigdata*.py")"find: ‘/data/data/com.termux/files/lib/python3.11’: No such file or directory

similarly

~ $ _file="$(find $TERMUX_PREFIX/lib/python3.11 -name "_sysconfigdata*.py")"
find: ‘/lib/python3.11’: No such file or directory
~ $ rm -rf $PREFIX/lib/python3.11/__pycache__
~ $ cp $_file "$_file".backup
cp: missing destination file operand after '.backup'
Try 'cp --help' for more information.
~ $ sed -i 's|-fno-openmp-implicit-rpath||g' "$_file"
sed: can't read : No such file or directory

@Biswa96
Copy link
Contributor

Biswa96 commented May 12, 2024

If you are in Android device or termux environment replace TERMUX_PREFIX with PREFIX.

TERMUX_PREFIX is used for build packages.

@Vladik01-11
Copy link

If you are in Android device or termux environment replace TERMUX_PREFIX with PREFIX.

TERMUX_PREFIX is used for build packages.

yes, it really helped)

@davidtompul-tvlk
Copy link

If you are in Android device or termux environment replace TERMUX_PREFIX with PREFIX.

TERMUX_PREFIX is used for build packages.

Yes, it works for me too. Thanks

@termux termux deleted a comment from moodydeel900 May 12, 2024
@ECHO-64
Copy link

ECHO-64 commented May 14, 2024

This issue will be difficult to fix in the builder side until next NDK ships.

A possible way is modifying $PREFIX/lib/python3.11/_sysconfigdata*.py manually.

_file="$(find $PREFIX/lib/python3.11 -name "_sysconfigdata*.py")"
rm -rf $PREFIX/lib/python3.11/__pycache__
cp $_file "$_file".backup
sed -i 's|-fno-openmp-implicit-rpath||g' "$_file"

Related: #19766

Edit: [1] Replace TERMUX_PREFIX with PREFIX.

it works for me too. thanks bro

@Duuckjing
Copy link

Duuckjing commented May 15, 2024

Thanks a lot, and it also works for clang++. #19766

@okineadev
Copy link
Sponsor

This issue will be difficult to fix in the builder side until next NDK ships.

A possible way is modifying $PREFIX/lib/python3.11/_sysconfigdata*.py manually.

_file="$(find $PREFIX/lib/python3.11 -name "_sysconfigdata*.py")"
rm -rf $PREFIX/lib/python3.11/__pycache__
cp $_file "$_file".backup
sed -i 's|-fno-openmp-implicit-rpath||g' "$_file"

Related: #19766

Edit:
[1] Replace TERMUX_PREFIX with PREFIX.

I have been awake for several nights looking for a solution to this problem, now I have found it, thank you, now everything works!

@Khalid0909
Copy link

Khalid0909 commented May 23, 2024

This issue will be difficult to fix in the builder side until next NDK ships.

A possible way is modifying $PREFIX/lib/python3.11/_sysconfigdata*.py manually.

_file="$(find $PREFIX/lib/python3.11 -name "_sysconfigdata*.py")"
rm -rf $PREFIX/lib/python3.11/__pycache__
cp $_file "$_file".backup
sed -i 's|-fno-openmp-implicit-rpath||g' "$_file"

Related: #19766

Edit: [1] Replace TERMUX_PREFIX with PREFIX.

THANK YOU. IT WORK'S FOR ME I FINALLY FOUND A SOLUTION.

@uzi98f
Copy link

uzi98f commented May 24, 2024

Hi new in termux, how I install manually that? can someone give step by step please

_file="$(find $PREFIX/lib/python3.11 -name "_sysconfigdata*.py")"
rm -rf $PREFIX/lib/python3.11/pycache
cp $_file "$_file".backup
sed -i 's|-fno-openmp-implicit-rpath||g' "$_file"

@okineadev

This comment was marked as off-topic.

@SamLukeYes
Copy link

I found a simpler workaround for this issue:

  1. install clang-16 from tur-repo
  2. set environment variable CC=clang-16

@Nekoplex

This comment was marked as off-topic.

@Nekoplex

This comment was marked as off-topic.

@okineadev

This comment was marked as off-topic.

@okineadev

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Something is not working properly.
Projects
None yet
Development

Successfully merging a pull request may close this issue.