seeker icon indicating copy to clipboard operation
seeker copied to clipboard

Installation failed -psutil

Open aljawary opened this issue 9 months ago • 12 comments

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 :

  • OS: Rising Os
  • OS Version: Android 13
  • Browser: chrome
  • Full Browser Version:

aljawary avatar May 06 '24 13:05 aljawary

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

thewhiteh4t avatar May 06 '24 17:05 thewhiteh4t

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 avatar May 13 '24 13:05 xyzzklk

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.

xyzzklk avatar May 14 '24 13:05 xyzzklk

Screenshot_20240514-192348.png

thewhiteh4t avatar May 14 '24 13:05 thewhiteh4t

Same error

Kartoshaaa avatar May 14 '24 16:05 Kartoshaaa

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

thewhiteh4t avatar May 14 '24 17:05 thewhiteh4t

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

xyzzklk avatar May 14 '24 22:05 xyzzklk

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

thewhiteh4t avatar May 15 '24 02:05 thewhiteh4t

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

Still the same error

Kartoshaaa avatar May 15 '24 03:05 Kartoshaaa

@Kartoshaaa check the link in my previous comment

thewhiteh4t avatar May 15 '24 04:05 thewhiteh4t

@Kartoshaaa check the link in my previous comment

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

Kartoshaaa avatar May 15 '24 14:05 Kartoshaaa

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

okineadev avatar May 16 '24 07:05 okineadev