thewhiteh4t / seeker

Accurately Locate Smartphones using Social Engineering
MIT License
6.71k stars 1.62k forks source link

Installation failed -psutil #499

Open aljawary opened 2 months ago

aljawary commented 2 months ago

Describe the Error / Feature Request

Everything is fine untill psutil installation part

To Reproduce

Expected behavior

Screenshots Screenshot_20240506-203142_Termux

Please complete the following information :

thewhiteh4t commented 2 months ago

@aljawary this is more of a termux issue, you need to read and fix the errors preventing installation of psutil

xyzzklk commented 2 months ago

Having the same problem. Cannot install psutil using pip in termux.

~/seeker $ pip install psutil
Collecting psutil                               Using cached psutil-5.9.8.tar.gz (503 kB)     Installing build dependencies ... done        Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... doneBuilding wheels for collected packages: psutil  Building wheel for psutil (pyproject.toml) ... error
  error: subprocess-exited-with-error         
  × Building wheel for psutil (pyproject.toml) did not run successfully.
  │ exit code: 1                                ╰─> [56 lines of output]                          running bdist_wheel                           running build                                 running build_py
      creating build                                creating build/lib.linux-aarch64-cpython-311                                                creating build/lib.linux-aarch64-cpython-311/psutil
      copying psutil/__init__.py -> build/lib.linux-aarch64-cpython-311/psutil
      copying psutil/_common.py -> build/lib.linux-aarch64-cpython-311/psutil
      copying psutil/_compat.py -> build/lib.linux-aarch64-cpython-311/psutil
      copying psutil/_psaix.py -> build/lib.linux-aarch64-cpython-311/psutil
      copying psutil/_psbsd.py -> build/lib.linux-aarch64-cpython-311/psutil
      copying psutil/_pslinux.py -> build/lib.linux-aarch64-cpython-311/psutil
      copying psutil/_psosx.py -> build/lib.linux-aarch64-cpython-311/psutil
      copying psutil/_psposix.py -> build/lib.linux-aarch64-cpython-311/psutil
      copying psutil/_pssunos.py -> build/lib.linux-aarch64-cpython-311/psutil
      copying psutil/_pswindows.py -> build/lib.linux-aarch64-cpython-311/psutil
      creating build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/__init__.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/__main__.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/runner.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_aix.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_bsd.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_connections.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_contracts.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_linux.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_memleaks.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_misc.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_osx.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_posix.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_process.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_process_all.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_sunos.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_system.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_testutils.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_unicode.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_windows.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      running build_ext
      building 'psutil._psutil_linux' extension
      creating build/temp.linux-aarch64-cpython-311
      creating build/temp.linux-aarch64-cpython-311/psutil
      creating build/temp.linux-aarch64-cpython-311/psutil/arch
      creating build/temp.linux-aarch64-cpython-311/psutil/arch/linux
      aarch64-linux-android-clang -DNDEBUG -g -fwrapv -O3 -Wall -fstack-protector-strong -O3 -fstack-protector-strong -O3 -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=598 -DPy_LIMITED_API=0x03060000 -DPSUTIL_LINUX=1 -I/data/data/com.termux/files/usr/include/python3.11 -c psutil/_psutil_common.c -o build/temp.linux-aarch64-cpython-311/psutil/_psutil_common.o
      aarch64-linux-android-clang -DNDEBUG -g -fwrapv -O3 -Wall -fstack-protector-strong -O3 -fstack-protector-strong -O3 -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=598 -DPy_LIMITED_API=0x03060000 -DPSUTIL_LINUX=1 -I/data/data/com.termux/files/usr/include/python3.11 -c psutil/_psutil_linux.c -o build/temp.linux-aarch64-cpython-311/psutil/_psutil_linux.o
      aarch64-linux-android-clang -DNDEBUG -g -fwrapv -O3 -Wall -fstack-protector-strong -O3 -fstack-protector-strong -O3 -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=598 -DPy_LIMITED_API=0x03060000 -DPSUTIL_LINUX=1 -I/data/data/com.termux/files/usr/include/python3.11 -c psutil/_psutil_posix.c -o build/temp.linux-aarch64-cpython-311/psutil/_psutil_posix.o
      aarch64-linux-android-clang -DNDEBUG -g -fwrapv -O3 -Wall -fstack-protector-strong -O3 -fstack-protector-strong -O3 -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=598 -DPy_LIMITED_API=0x03060000 -DPSUTIL_LINUX=1 -I/data/data/com.termux/files/usr/include/python3.11 -c psutil/arch/linux/disk.c -o build/temp.linux-aarch64-cpython-311/psutil/arch/linux/disk.o
      aarch64-linux-android-clang -DNDEBUG -g -fwrapv -O3 -Wall -fstack-protector-strong -O3 -fstack-protector-strong -O3 -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=598 -DPy_LIMITED_API=0x03060000 -DPSUTIL_LINUX=1 -I/data/data/com.termux/files/usr/include/python3.11 -c psutil/arch/linux/mem.c -o build/temp.linux-aarch64-cpython-311/psutil/arch/linux/mem.o
      aarch64-linux-android-clang -DNDEBUG -g -fwrapv -O3 -Wall -fstack-protector-strong -O3 -fstack-protector-strong -O3 -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=598 -DPy_LIMITED_API=0x03060000 -DPSUTIL_LINUX=1 -I/data/data/com.termux/files/usr/include/python3.11 -c psutil/arch/linux/net.c -o build/temp.linux-aarch64-cpython-311/psutil/arch/linux/net.o
      aarch64-linux-android-clang -DNDEBUG -g -fwrapv -O3 -Wall -fstack-protector-strong -O3 -fstack-protector-strong -O3 -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=598 -DPy_LIMITED_API=0x03060000 -DPSUTIL_LINUX=1 -I/data/data/com.termux/files/usr/include/python3.11 -c psutil/arch/linux/proc.c -o build/temp.linux-aarch64-cpython-311/psutil/arch/linux/proc.o
      aarch64-linux-android-clang -DNDEBUG -g -fwrapv -O3 -Wall -fstack-protector-strong -O3 -fstack-protector-strong -O3 -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=598 -DPy_LIMITED_API=0x03060000 -DPSUTIL_LINUX=1 -I/data/data/com.termux/files/usr/include/python3.11 -c psutil/arch/linux/users.c -o build/temp.linux-aarch64-cpython-311/psutil/arch/linux/users.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/psutil/_psutil_common.o build/temp.linux-aarch64-cpython-311/psutil/_psutil_linux.o build/temp.linux-aarch64-cpython-311/psutil/_psutil_posix.o build/temp.linux-aarch64-cpython-311/psutil/arch/linux/disk.o build/temp.linux-aarch64-cpython-311/psutil/arch/linux/mem.o build/temp.linux-aarch64-cpython-311/psutil/arch/linux/net.o build/temp.linux-aarch64-cpython-311/psutil/arch/linux/proc.o build/temp.linux-aarch64-cpython-311/psutil/arch/linux/users.o -L/data/data/com.termux/files/usr/lib -lpython3.11 -o build/lib.linux-aarch64-cpython-311/psutil/_psutil_linux.abi3.so
      aarch64-linux-android-clang: error: unknown argument: '-fno-openmp-implicit-rpath'
      aarch64-linux-android-clang: error: unknown argument: '-fno-openmp-implicit-rpath'
      psutil could not be installed from sources. Perhaps Python header files are not installed. Try running:
        sudo apt-get install gcc python3-dev
      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 psutil
Failed to build psutil
ERROR: Could not build wheels for psutil, which is required to install pyproject.toml-based projects
~/seeker $
xyzzklk commented 2 months ago

A quick dirty bypass is to use kali in termux and install seeker within kali (no root required). However, I DON'T recommend this since it doesn't actually solves the problem, and this should not be a solution to this issue.

By doing this way, there will be no errors when installing psutil. In my case, I use AnLinux to install kali in termux.

Execute the following commands in termux to do so.

pkg install wget openssl-tool proot -y && hash -r && wget https://raw.githubusercontent.com/EXALAB/AnLinux-Resources/master/Scripts/Installer/Kali/kali.sh && bash kali.sh
./start-kali.sh
apt update && apt full-upgrade
apt intall python3 pip php git
apt install python3-requests python3-packaging python3-psutil
git clone https://github.com/thewhiteh4t/seeker.git
cd seeker
python3 seeker.py

It works well on my phone (Android 12). IMG_20240514_232716.jpg

Personally, I feel that when it comes to installing additional python libraries, termux becomes very unreliable. Many packages, such as venv, pyinstaller and psutil etc., cannot be successfully installed.

thewhiteh4t commented 2 months ago

Screenshot_20240514-192348.png

Kartoshaaa commented 2 months ago

Same error

thewhiteh4t commented 2 months ago

@Kartoshaaa do you have wheel installed ? if not then try pip install wheel and then try pip install psutil

xyzzklk commented 2 months ago

On my phone I don't have wheel installed. But even after installation, the command with -no-cache-dir -U still doesn't work for me.

~ $ pip install wheel
Collecting wheel
  Using cached wheel-0.43.0-py3-none-any.whl.metadata (2.2 kB)
Using cached wheel-0.43.0-py3-none-any.whl (65 kB)
Installing collected packages: wheel
Successfully installed wheel-0.43.0
~ $ pip install psutil --no-cache-dir -U
Collecting psutil
  Downloading psutil-5.9.8.tar.gz (503 kB)
     ━━━━━━━━━━ 503.2/50… 2.2 MB/s eta 0:00:00
                kB
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: psutil
  Building wheel for psutil (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for psutil (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [56 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-aarch64-cpython-311
      creating build/lib.linux-aarch64-cpython-311/psutil
      copying psutil/__init__.py -> build/lib.linux-aarch64-cpython-311/psutil
      copying psutil/_common.py -> build/lib.linux-aarch64-cpython-311/psutil
      copying psutil/_compat.py -> build/lib.linux-aarch64-cpython-311/psutil
      copying psutil/_psaix.py -> build/lib.linux-aarch64-cpython-311/psutil
      copying psutil/_psbsd.py -> build/lib.linux-aarch64-cpython-311/psutil
      copying psutil/_pslinux.py -> build/lib.linux-aarch64-cpython-311/psutil
      copying psutil/_psosx.py -> build/lib.linux-aarch64-cpython-311/psutil
      copying psutil/_psposix.py -> build/lib.linux-aarch64-cpython-311/psutil
      copying psutil/_pssunos.py -> build/lib.linux-aarch64-cpython-311/psutil
      copying psutil/_pswindows.py -> build/lib.linux-aarch64-cpython-311/psutil
      creating build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/__init__.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/__main__.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/runner.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_aix.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_bsd.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_connections.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_contracts.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_linux.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_memleaks.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_misc.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_osx.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_posix.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_process.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_process_all.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_sunos.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_system.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_testutils.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_unicode.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_windows.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      running build_ext
      building 'psutil._psutil_linux' extension
      creating build/temp.linux-aarch64-cpython-311
      creating build/temp.linux-aarch64-cpython-311/psutil
      creating build/temp.linux-aarch64-cpython-311/psutil/arch
      creating build/temp.linux-aarch64-cpython-311/psutil/arch/linux
      aarch64-linux-android-clang -DNDEBUG -g -fwrapv -O3 -Wall -fstack-protector-strong -O3 -fstack-protector-strong -O3 -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=598 -DPy_LIMITED_API=0x03060000 -DPSUTIL_LINUX=1 -I/data/data/com.termux/files/usr/include/python3.11 -c psutil/_psutil_common.c -o build/temp.linux-aarch64-cpython-311/psutil/_psutil_common.o
      aarch64-linux-android-clang -DNDEBUG -g -fwrapv -O3 -Wall -fstack-protector-strong -O3 -fstack-protector-strong -O3 -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=598 -DPy_LIMITED_API=0x03060000 -DPSUTIL_LINUX=1 -I/data/data/com.termux/files/usr/include/python3.11 -c psutil/_psutil_linux.c -o build/temp.linux-aarch64-cpython-311/psutil/_psutil_linux.o
      aarch64-linux-android-clang -DNDEBUG -g -fwrapv -O3 -Wall -fstack-protector-strong -O3 -fstack-protector-strong -O3 -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=598 -DPy_LIMITED_API=0x03060000 -DPSUTIL_LINUX=1 -I/data/data/com.termux/files/usr/include/python3.11 -c psutil/_psutil_posix.c -o build/temp.linux-aarch64-cpython-311/psutil/_psutil_posix.o
      aarch64-linux-android-clang -DNDEBUG -g -fwrapv -O3 -Wall -fstack-protector-strong -O3 -fstack-protector-strong -O3 -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=598 -DPy_LIMITED_API=0x03060000 -DPSUTIL_LINUX=1 -I/data/data/com.termux/files/usr/include/python3.11 -c psutil/arch/linux/disk.c -o build/temp.linux-aarch64-cpython-311/psutil/arch/linux/disk.o
      aarch64-linux-android-clang -DNDEBUG -g -fwrapv -O3 -Wall -fstack-protector-strong -O3 -fstack-protector-strong -O3 -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=598 -DPy_LIMITED_API=0x03060000 -DPSUTIL_LINUX=1 -I/data/data/com.termux/files/usr/include/python3.11 -c psutil/arch/linux/mem.c -o build/temp.linux-aarch64-cpython-311/psutil/arch/linux/mem.o
      aarch64-linux-android-clang -DNDEBUG -g -fwrapv -O3 -Wall -fstack-protector-strong -O3 -fstack-protector-strong -O3 -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=598 -DPy_LIMITED_API=0x03060000 -DPSUTIL_LINUX=1 -I/data/data/com.termux/files/usr/include/python3.11 -c psutil/arch/linux/net.c -o build/temp.linux-aarch64-cpython-311/psutil/arch/linux/net.o
      aarch64-linux-android-clang -DNDEBUG -g -fwrapv -O3 -Wall -fstack-protector-strong -O3 -fstack-protector-strong -O3 -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=598 -DPy_LIMITED_API=0x03060000 -DPSUTIL_LINUX=1 -I/data/data/com.termux/files/usr/include/python3.11 -c psutil/arch/linux/proc.c -o build/temp.linux-aarch64-cpython-311/psutil/arch/linux/proc.o
      aarch64-linux-android-clang -DNDEBUG -g -fwrapv -O3 -Wall -fstack-protector-strong -O3 -fstack-protector-strong -O3 -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=598 -DPy_LIMITED_API=0x03060000 -DPSUTIL_LINUX=1 -I/data/data/com.termux/files/usr/include/python3.11 -c psutil/arch/linux/users.c -o build/temp.linux-aarch64-cpython-311/psutil/arch/linux/users.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/psutil/_psutil_common.o build/temp.linux-aarch64-cpython-311/psutil/_psutil_linux.o build/temp.linux-aarch64-cpython-311/psutil/_psutil_posix.o build/temp.linux-aarch64-cpython-311/psutil/arch/linux/disk.o build/temp.linux-aarch64-cpython-311/psutil/arch/linux/mem.o build/temp.linux-aarch64-cpython-311/psutil/arch/linux/net.o build/temp.linux-aarch64-cpython-311/psutil/arch/linux/proc.o build/temp.linux-aarch64-cpython-311/psutil/arch/linux/users.o -L/data/data/com.termux/files/usr/lib -lpython3.11 -o build/lib.linux-aarch64-cpython-311/psutil/_psutil_linux.abi3.so
      aarch64-linux-android-clang: error: unknown argument: '-fno-openmp-implicit-rpath'
      aarch64-linux-android-clang: error: unknown argument: '-fno-openmp-implicit-rpath'
      psutil could not be installed from sources. Perhaps Python header files are not installed. Try running:
        sudo apt-get install gcc python3-dev
      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 psutil
Failed to build psutil
ERROR: Could not build wheels for psutil, which is required to install pyproject.toml-based projects
thewhiteh4t commented 2 months ago

@xyzzklk check this out https://github.com/termux/termux-packages/issues/20039

Kartoshaaa commented 2 months ago

@Kartoshaaa do you have wheel installed ? if not then try pip install wheel and then try pip install psutil

Still the same error

thewhiteh4t commented 2 months ago

@Kartoshaaa check the link in my previous comment

Kartoshaaa commented 2 months ago

@Kartoshaaa check the link in my previous comment

It works now, thank you!!!!!!!

okineadev commented 2 months ago

On my phone I don't have wheel installed. But even after installation, the command with -no-cache-dir -U still doesn't work for me.

~ $ pip install wheel
Collecting wheel
  Using cached wheel-0.43.0-py3-none-any.whl.metadata (2.2 kB)
Using cached wheel-0.43.0-py3-none-any.whl (65 kB)
Installing collected packages: wheel
Successfully installed wheel-0.43.0
~ $ pip install psutil --no-cache-dir -U
Collecting psutil
  Downloading psutil-5.9.8.tar.gz (503 kB)
     ━━━━━━━━━━ 503.2/50… 2.2 MB/s eta 0:00:00
                kB
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: psutil
  Building wheel for psutil (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for psutil (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [56 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-aarch64-cpython-311
      creating build/lib.linux-aarch64-cpython-311/psutil
      copying psutil/__init__.py -> build/lib.linux-aarch64-cpython-311/psutil
      copying psutil/_common.py -> build/lib.linux-aarch64-cpython-311/psutil
      copying psutil/_compat.py -> build/lib.linux-aarch64-cpython-311/psutil
      copying psutil/_psaix.py -> build/lib.linux-aarch64-cpython-311/psutil
      copying psutil/_psbsd.py -> build/lib.linux-aarch64-cpython-311/psutil
      copying psutil/_pslinux.py -> build/lib.linux-aarch64-cpython-311/psutil
      copying psutil/_psosx.py -> build/lib.linux-aarch64-cpython-311/psutil
      copying psutil/_psposix.py -> build/lib.linux-aarch64-cpython-311/psutil
      copying psutil/_pssunos.py -> build/lib.linux-aarch64-cpython-311/psutil
      copying psutil/_pswindows.py -> build/lib.linux-aarch64-cpython-311/psutil
      creating build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/__init__.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/__main__.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/runner.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_aix.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_bsd.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_connections.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_contracts.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_linux.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_memleaks.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_misc.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_osx.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_posix.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_process.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_process_all.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_sunos.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_system.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_testutils.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_unicode.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      copying psutil/tests/test_windows.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
      running build_ext
      building 'psutil._psutil_linux' extension
      creating build/temp.linux-aarch64-cpython-311
      creating build/temp.linux-aarch64-cpython-311/psutil
      creating build/temp.linux-aarch64-cpython-311/psutil/arch
      creating build/temp.linux-aarch64-cpython-311/psutil/arch/linux
      aarch64-linux-android-clang -DNDEBUG -g -fwrapv -O3 -Wall -fstack-protector-strong -O3 -fstack-protector-strong -O3 -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=598 -DPy_LIMITED_API=0x03060000 -DPSUTIL_LINUX=1 -I/data/data/com.termux/files/usr/include/python3.11 -c psutil/_psutil_common.c -o build/temp.linux-aarch64-cpython-311/psutil/_psutil_common.o
      aarch64-linux-android-clang -DNDEBUG -g -fwrapv -O3 -Wall -fstack-protector-strong -O3 -fstack-protector-strong -O3 -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=598 -DPy_LIMITED_API=0x03060000 -DPSUTIL_LINUX=1 -I/data/data/com.termux/files/usr/include/python3.11 -c psutil/_psutil_linux.c -o build/temp.linux-aarch64-cpython-311/psutil/_psutil_linux.o
      aarch64-linux-android-clang -DNDEBUG -g -fwrapv -O3 -Wall -fstack-protector-strong -O3 -fstack-protector-strong -O3 -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=598 -DPy_LIMITED_API=0x03060000 -DPSUTIL_LINUX=1 -I/data/data/com.termux/files/usr/include/python3.11 -c psutil/_psutil_posix.c -o build/temp.linux-aarch64-cpython-311/psutil/_psutil_posix.o
      aarch64-linux-android-clang -DNDEBUG -g -fwrapv -O3 -Wall -fstack-protector-strong -O3 -fstack-protector-strong -O3 -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=598 -DPy_LIMITED_API=0x03060000 -DPSUTIL_LINUX=1 -I/data/data/com.termux/files/usr/include/python3.11 -c psutil/arch/linux/disk.c -o build/temp.linux-aarch64-cpython-311/psutil/arch/linux/disk.o
      aarch64-linux-android-clang -DNDEBUG -g -fwrapv -O3 -Wall -fstack-protector-strong -O3 -fstack-protector-strong -O3 -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=598 -DPy_LIMITED_API=0x03060000 -DPSUTIL_LINUX=1 -I/data/data/com.termux/files/usr/include/python3.11 -c psutil/arch/linux/mem.c -o build/temp.linux-aarch64-cpython-311/psutil/arch/linux/mem.o
      aarch64-linux-android-clang -DNDEBUG -g -fwrapv -O3 -Wall -fstack-protector-strong -O3 -fstack-protector-strong -O3 -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=598 -DPy_LIMITED_API=0x03060000 -DPSUTIL_LINUX=1 -I/data/data/com.termux/files/usr/include/python3.11 -c psutil/arch/linux/net.c -o build/temp.linux-aarch64-cpython-311/psutil/arch/linux/net.o
      aarch64-linux-android-clang -DNDEBUG -g -fwrapv -O3 -Wall -fstack-protector-strong -O3 -fstack-protector-strong -O3 -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=598 -DPy_LIMITED_API=0x03060000 -DPSUTIL_LINUX=1 -I/data/data/com.termux/files/usr/include/python3.11 -c psutil/arch/linux/proc.c -o build/temp.linux-aarch64-cpython-311/psutil/arch/linux/proc.o
      aarch64-linux-android-clang -DNDEBUG -g -fwrapv -O3 -Wall -fstack-protector-strong -O3 -fstack-protector-strong -O3 -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=598 -DPy_LIMITED_API=0x03060000 -DPSUTIL_LINUX=1 -I/data/data/com.termux/files/usr/include/python3.11 -c psutil/arch/linux/users.c -o build/temp.linux-aarch64-cpython-311/psutil/arch/linux/users.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/psutil/_psutil_common.o build/temp.linux-aarch64-cpython-311/psutil/_psutil_linux.o build/temp.linux-aarch64-cpython-311/psutil/_psutil_posix.o build/temp.linux-aarch64-cpython-311/psutil/arch/linux/disk.o build/temp.linux-aarch64-cpython-311/psutil/arch/linux/mem.o build/temp.linux-aarch64-cpython-311/psutil/arch/linux/net.o build/temp.linux-aarch64-cpython-311/psutil/arch/linux/proc.o build/temp.linux-aarch64-cpython-311/psutil/arch/linux/users.o -L/data/data/com.termux/files/usr/lib -lpython3.11 -o build/lib.linux-aarch64-cpython-311/psutil/_psutil_linux.abi3.so
      aarch64-linux-android-clang: error: unknown argument: '-fno-openmp-implicit-rpath'
      aarch64-linux-android-clang: error: unknown argument: '-fno-openmp-implicit-rpath'
      psutil could not be installed from sources. Perhaps Python header files are not installed. Try running:
        sudo apt-get install gcc python3-dev
      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 psutil
Failed to build psutil
ERROR: Could not build wheels for psutil, which is required to install pyproject.toml-based projects

Here is the command that will solve this error:

_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"

Taken from: https://github.com/termux/termux-packages/issues/20039#issuecomment-2096494418