Jump to content

Error installing YoLink while building psutil


Scott847
Go to solution Solved by Scott847,

Recommended Posts

Posted

I'm getting an error trying to install YoLink on Polyglot 3.1.16 with Polisy IoX 5.4.5.

Perhaps a problem during installation while building psutil, related to limits.h not being found?

Following is the main part of the log, full log attached:

12/17/2022, 09:12:44 [pg3] info: NSChild: YoLink(1) /bin/sh: Building wheels for collected packages: psutil
12/17/2022, 09:12:44 [pg3] info: NSChild: YoLink(1) /bin/sh:   Building wheel for psutil (pyproject.toml): started
12/17/2022, 09:12:48 [pg3] info: NSChild: YoLink(1) /bin/sh:   Building wheel for psutil (pyproject.toml): finished with status 'error'
12/17/2022, 09:12:48 [pg3] error: NSChild: YoLink(1) /bin/sh:   error: subprocess-exited-with-error
  × Building wheel for psutil (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [48 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.freebsd-13.1-RELEASE-p5-amd64-cpython-39
      creating build/lib.freebsd-13.1-RELEASE-p5-amd64-cpython-39/psutil
      copying psutil/_psposix.py -> build/lib.freebsd-13.1-RELEASE-p5-amd64-cpython-39/psutil
      copying psutil/_pswindows.py -> build/lib.freebsd-13.1-RELEASE-p5-amd64-cpython-39/psutil
      copying psutil/_pssunos.py -> build/lib.freebsd-13.1-RELEASE-p5-amd64-cpython-39/psutil
<snip>
      copying psutil/tests/test_sunos.py -> build/lib.freebsd-13.1-RELEASE-p5-amd64-cpython-39/psutil/tests
      copying psutil/tests/test_system.py -> build/lib.freebsd-13.1-RELEASE-p5-amd64-cpython-39/psutil/tests
      copying psutil/tests/test_osx.py -> build/lib.freebsd-13.1-RELEASE-p5-amd64-cpython-39/psutil/tests
      running build_ext
      building 'psutil._psutil_bsd' extension
      creating build/temp.freebsd-13.1-RELEASE-p5-amd64-cpython-39
      creating build/temp.freebsd-13.1-RELEASE-p5-amd64-cpython-39/psutil
      creating build/temp.freebsd-13.1-RELEASE-p5-amd64-cpython-39/psutil/arch
      creating build/temp.freebsd-13.1-RELEASE-p5-amd64-cpython-39/psutil/arch/freebsd
      cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_BSD=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=594 -DPSUTIL_FREEBSD=1 -I/usr/local/include/python3.9 -c psutil/_psutil_bsd.c -o build/temp.freebsd-13.1-RELEASE-p5-amd64-cpython-39/psutil/_psutil_bsd.o
      In file included from psutil/_psutil_bsd.c:22:
      /usr/local/include/python3.9/Python.h:11:10: fatal error: 'limits.h' file not found
      #include <limits.h>
               ^~~~~~~~~~
      1 error generated.
      error: command '/usr/bin/cc' failed with exit code 1
      [end of output]
  note: This error originates from a subprocess, and is likely not a problem with pip.
12/17/2022, 09:12:48 [pg3] error: NSChild: YoLink(1) /bin/sh:   ERROR: Failed building wheel for psutil
12/17/2022, 09:12:48 [pg3] info: NSChild: YoLink(1) /bin/sh: Failed to build psutil
12/17/2022, 09:12:48 [pg3] error: NSChild: YoLink(1) /bin/sh: ERROR: Could not build wheels for psutil, which is required to install pyproject.toml-based projects

 

2022-12-17 YoLink Installation Log.txt

Posted
1 hour ago, Panda88 said:

yes - looks like a build error - I was on 5.4.4 when building it and used release 5.9.2 

@Michel Kohanim - Any input as to why psutil will fail build on 5.4.5?

@Michel Kohanim - FYI I'm getting the same psutil build errors using yesterday's updated IoX 5.5.0 on a Polisy that I reinstalled on Tuesday with the Polisy FreeBSD 13.1 mSATA image.

12/17/2022, 12:26:15 [pg3] info: NSChild: YoLink(1) /bin/sh: Building wheels for collected packages: psutil
12/17/2022, 12:26:15 [pg3] info: NSChild: YoLink(1) /bin/sh:   Building wheel for psutil (pyproject.toml): started
12/17/2022, 12:26:18 [pg3] info: NSChild: YoLink(1) /bin/sh:   Building wheel for psutil (pyproject.toml): finished with status 'error'
12/17/2022, 12:26:19 [pg3] error: NSChild: YoLink(1) /bin/sh:   error: subprocess-exited-with-error
  
  × Building wheel for psutil (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [48 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.freebsd-13.1-RELEASE-p5-amd64-cpython-39
      creating build/lib.freebsd-13.1-RELEASE-p5-amd64-cpython-39/psutil
      copying psutil/__init__.py -> build/lib.freebsd-13.1-RELEASE-p5-amd64-cpython-39/psutil
      copying psutil/_pslinux.py -> build/lib.freebsd-13.1-RELEASE-p5-amd64-cpython-39/psutil
      copying psutil/_psaix.py -> build/lib.freebsd-13.1-RELEASE-p5-amd64-cpython-39/psutil
<snip>
      copying psutil/tests/test_testutils.py -> build/lib.freebsd-13.1-RELEASE-p5-amd64-cpython-39/psutil/tests
      copying psutil/tests/test_aix.py -> build/lib.freebsd-13.1-RELEASE-p5-amd64-cpython-39/psutil/tests
      copying psutil/tests/test_process.py -> build/lib.freebsd-13.1-RELEASE-p5-amd64-cpython-39/psutil/tests
      running build_ext
      building 'psutil._psutil_bsd' extension
      creating build/temp.freebsd-13.1-RELEASE-p5-amd64-cpython-39
      creating build/temp.freebsd-13.1-RELEASE-p5-amd64-cpython-39/psutil
      creating build/temp.freebsd-13.1-RELEASE-p5-amd64-cpython-39/psutil/arch
      creating build/temp.freebsd-13.1-RELEASE-p5-amd64-cpython-39/psutil/arch/freebsd
      cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_BSD=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=594 -DPSUTIL_FREEBSD=1 -I/usr/local/include/python3.9 -c psutil/_psutil_bsd.c -o build/temp.freebsd-13.1-RELEASE-p5-amd64-cpython-39/psutil/_psutil_bsd.o
      In file included from psutil/_psutil_bsd.c:22:
      /usr/local/include/python3.9/Python.h:11:10: fatal error: 'limits.h' file not found
      #include <limits.h>
               ^~~~~~~~~~
      1 error generated.
      error: command '/usr/bin/cc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
12/17/2022, 12:26:19 [pg3] error: NSChild: YoLink(1) /bin/sh:   ERROR: Failed building wheel for psutil
12/17/2022, 12:26:19 [pg3] info: NSChild: YoLink(1) /bin/sh: Failed to build psutil
12/17/2022, 12:26:19 [pg3] error: NSChild: YoLink(1) /bin/sh: ERROR: Could not build wheels for psutil, which is required to install pyproject.toml-based projects
Posted
5 hours ago, Panda88 said:

I did update the requirement.txt to force the version I use - Can you try to delete and reinstall ?

 

I'm getting a different error: "NSChild: YoLink(1) /bin/sh: ERROR: Invalid requirement: 'psutil=5.9.2' (from line 4 of requirements.txt) Hint: = is not a valid operator. Did you mean == ?"

Here's the complete log:

12/21/2022, 18:10:23 [pg3] info: [XX:XX:XX:XX:XX:XX_1] :: Creating Node Server 'YoLink'
12/21/2022, 18:10:23 [pg3] info: Adding customparams entries to custom database
12/21/2022, 18:10:23 [pg3] info: Adding nsdata, oauth entries to custom database
12/21/2022, 18:10:23 [pg3] info: [XX:XX:XX:XX:XX:XX_1] Set nsdata
12/21/2022, 18:10:23 [pg3] info: [XX:XX:XX:XX:XX:XX_1] Set oauth
12/21/2022, 18:10:23 [pg3] info: checkLicense:: Updaing YoLink subscription expiration to 2023-01-01T05:24:10.000Z
12/21/2022, 18:10:23 [pg3] info: checkLicense:: YoLink Valid subscription license found. Expires: 2023-01-01T05:24:10.000Z
12/21/2022, 18:10:23 [pg3] warn: YoLink home directory exists already.
12/21/2022, 18:10:23 [pg3] info: [XX:XX:XX:XX:XX:XX_1] :: Cloning repository... https://github.com/Panda88CO/udi-yolink into /var/polyglot/pg3/ns/XXXXXXXXXXXX_1
12/21/2022, 18:10:31 [pg3] info: [XX:XX:XX:XX:XX:XX_1] :: Installation Complete. Added 'YoLink' to database...
12/21/2022, 18:10:31 [pg3] info: [XX:XX:XX:XX:XX:XX_1] 'YoLink' installed into ISY successfully...
12/21/2022, 18:10:34 [pg3] info: NSChild: YoLink(1) /bin/sh: Defaulting to user installation because normal site-packages is not writeable
12/21/2022, 18:10:35 [pg3] info: NSChild: YoLink(1) /bin/sh: Requirement already satisfied: pip in /usr/local/lib/python3.9/site-packages (22.2.2)
12/21/2022, 18:10:36 [pg3] info: NSChild: YoLink(1) /bin/sh: Collecting pip
12/21/2022, 18:10:36 [pg3] info: NSChild: YoLink(1) /bin/sh:   Using cached pip-22.3.1-py3-none-any.whl (2.1 MB)
12/21/2022, 18:10:37 [pg3] info: [XX:XX:XX:XX:XX:XX_1] Retrieved customparams
12/21/2022, 18:10:37 [pg3] info: [XX:XX:XX:XX:XX:XX_1] Retrieved oauth
12/21/2022, 18:10:38 [pg3] info: NSChild: YoLink(1) /bin/sh: Installing collected packages: pip
12/21/2022, 18:10:51 [pg3] error: NSChild: YoLink(1) /bin/sh:   WARNING: The scripts pip, pip3 and pip3.9 are installed in '/var/polyglot/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
12/21/2022, 18:10:51 [pg3] info: NSChild: YoLink(1) /bin/sh: Successfully installed pip-22.3.1
12/21/2022, 18:10:55 [pg3] error: NSChild: YoLink(1) /bin/sh: ERROR: Invalid requirement: 'psutil=5.9.2' (from line 4 of requirements.txt)
Hint: = is not a valid operator. Did you mean == ?
12/21/2022, 18:10:55 [pg3] info: NSChild: YoLink(1) /bin/sh: exited with cause code: 1
12/21/2022, 18:10:55 [pg3] error: installNs: Error: Non-zero exit code: 1
    at ChildProcess.<anonymous> (/var/polyglot/node_modules/@universaldevices/pg3/lib/services/node servers.js:53:30)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1091:16)
    at ChildProcess._handle.onexit (node:internal/child_process:302:5)
12/21/2022, 18:10:55 [pg3] info: startNs:: YoLink
12/21/2022, 18:10:55 [pg3] info: startNs:: YoLink is valid
12/21/2022, 18:10:56 [pg3] info: checkLicense:: YoLink Valid subscription license found. Expires: 2023-01-01T05:24:10.000Z
12/21/2022, 18:10:56 [pg3] info: startNs:: YoLink finished update check
12/21/2022, 18:10:56 [pg3] info: [YoLink(1)] :: Starting Node Server - Version 0.7.3
12/21/2022, 18:10:56 [pg3] info: startNs:: YoLink updating database (enabled, timestarted)
12/21/2022, 18:10:57 [pg3] info: startNs:: YoLink starting polls
12/21/2022, 18:10:57 [pg3] info: Checking if ${Node Server.name} has expired
12/21/2022, 18:10:57 [pg3] info: Starting Node Server Info timer 0
12/21/2022, 18:10:57 [pg3] error: [YoLink(1)] :: STDERR: Traceback (most recent call last):
  File "/var/polyglot/pg3/ns/XXXXXXXXXXXX_1/./udi-YoLink.py", line 11, in <module>
12/21/2022, 18:10:57 [pg3] error: [YoLink(1)] :: STDERR:     from yoLink_init_V3 import YoLinkInitPAC
  File "/var/polyglot/pg3/ns/XXXXXXXXXXXX_1/yoLink_init_V3.py", line 5, in <module>
    import psutil
ModuleNotFoundError: No module named 'psutil'
12/21/2022, 18:10:57 [pg3] info: [YoLink(1)] :: Exit cause code: 1 - signal: null

 

Posted
On 12/21/2022 at 2:59 PM, Panda88 said:

I did update the requirement.txt to force the version I use - Can you try to delete and reinstall ?

I noticed you're specifying "psutil==5.9.2" in requirements.txt and now I'm getting the previous error again.

It appears PG3 isn't finding psutil so it tries to run the c compiler to build psutil and runs into an error because it can't find "limits.h".

I assume this limits.h include file must be somewhere on your system but not mine. Do you know where limits.h is located on your system? Or what I can install that would include this file?

This is the log showing the psutil compile failure:

cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_BSD=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=592 -DPSUTIL_FREEBSD=1 -I/usr/local/include/python3.9 -c psutil/_psutil_bsd.c -o build/temp.freebsd-13.1-RELEASE-p5-amd64-cpython-39/psutil/_psutil_bsd.o
In file included from psutil/_psutil_bsd.c:22:
/usr/local/include/python3.9/Python.h:11:10: fatal error: 'limits.h' file not found
#include <limits.h>
         ^~~~~~~~~~
1 error generated.
error: command '/usr/bin/cc' failed with exit code 1
  • Solution
Posted

I was able to get YoLink installed and it appears to be working great! Temp/humidity sensors and leak sensors are all reporting normally.

The problem I was experiencing during installation was a failure when automatically compiling psutil after the PG3 YoLink node server couldn't find psutil 5.9.2.

I'm not sure if this is a workaround in need of a permanent solution, or a solution that should be documented. Anyway, the solution was to install the psutil package:

sudo pkg install py39-psutil

Guest
This topic is now closed to further replies.

×
×
  • Create New...