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

Installation failed -psutil #499

Open
aljawary opened this issue May 6, 2024 · 12 comments
Open

Installation failed -psutil #499

aljawary opened this issue May 6, 2024 · 12 comments

Comments

@aljawary
Copy link

aljawary commented May 6, 2024

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 aljawary changed the title Installion failed -psutil Installation failed -psutil May 6, 2024
@thewhiteh4t
Copy link
Owner

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

@xyzzklk
Copy link

xyzzklk commented May 13, 2024

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
Copy link

xyzzklk commented May 14, 2024

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
Copy link
Owner

Screenshot_20240514-192348.png

@Kartoshaaa
Copy link

Same error

@thewhiteh4t
Copy link
Owner

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

@xyzzklk
Copy link

xyzzklk commented May 14, 2024

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
Copy link
Owner

@xyzzklk check this out termux/termux-packages#20039

@Kartoshaaa
Copy link

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

Still the same error

@thewhiteh4t
Copy link
Owner

@Kartoshaaa check the link in my previous comment

@Kartoshaaa
Copy link

@Kartoshaaa check the link in my previous comment

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

@okineadev
Copy link

okineadev commented May 16, 2024

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: termux/termux-packages#20039 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants