ihrapsa / KlipperWrt

A guide to install Klipper with fluidd, Mainsail or Duet-Web-Control and webcam stream in OpenWrt. Mainly created around the Creality Wi-Fi box but any OpenWrt running device with similar specs will work just fine.
180 stars 39 forks source link

Install issue with 2_script_manual.sh #39

Open the-moog opened 1 year ago

the-moog commented 1 year ago

Issue with the pip install ... lmdb ... line in scripts/2_script_manual.sh

Error text

Collecting lmdb
  Using cached lmdb-1.3.0.tar.gz (881 kB)
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.
  Preparing metadata (setup.py) ... error
error: metadata-generation-failed

The above error did not highlight the actual problem. Running pip with -v did.

It seems lmdb is patched and built in situ. It needs pip install wheel and opkg install patch to install.

ihrapsa commented 1 year ago

Hi, did you manage to bypass that with patch and wheel?

the-moog commented 1 year ago

@ihrapsa The install of lmdb fails because it's pip install invocation compiles some Python C extensions on the fly then installs them (using wheel). For some reason in doing that it applies a patch to the source, so I guess the author of that component never finished the job on the Python version in that OpenWRT release. The binutils patch tool is simply missing on the Creality Box port of OpenWRT so it tries to run it, silently fails then does not compile. Sadly pip's error reporting buried this and reported the egg-info error instead. Also the CrealityBox OpenWRT is not in the main OpenWRT repo so it's lagging somewhat meaning lots of updates fail due to kernel compatibility. Maybe I will try and find time to fix that.

long story short (it took hours for me to work this one out) I did something like sudo opkg install patch sudo pip install wheel

(IIRC, it was a few days back and my memory is not great - I may have updated pip too)

ihrapsa commented 1 year ago

Glad you fixed it eventually. Yeah, unfortunately the box is not officially supported yet. Some packages can't be built on the target (mostly Python C extensions) and because of that I always prefer to use openwrt repo prebuilt python modules. If that's not an option I crosscompile. That lmdb pacakge used to be installed from a crosscompiled .ipk I put here but switched back to pip when the target compilation issues resolved. The package is pretty old and comes bundled with some other python package that had similar issues.