fix(install): avoid apt-package uninstall failure during web dep install#371
Conversation
On a fresh Pi install, requests is installed via apt (python3-requests), which ships no pip RECORD file. When pip later installs google-api-python-client, its dependency tree pulls a newer requests and attempts to uninstall the apt copy, failing with "uninstall-no-record-file" and aborting the whole install at step 7 (web interface dependencies). Add --ignore-installed to install_via_pip so pip lays the new version down in /usr/local (shadowing the apt copy) instead of trying to remove an apt-managed package. This resolves the failure for any transitive dependency pip needs to upgrade over an apt-installed package, not just requests. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 14 minutes and 49 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds Changespip --ignore-installed flag
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
scripts/install_dependencies_apt.py (1)
211-211:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winAdd
--ignore-installedto the rgbmatrix pip install for consistency.The rgbmatrix installation command should include
--ignore-installedfor the same reason as the maininstall_via_pip()function: to prevent failures when pip needs to upgrade apt-managed dependencies. While failures here are tolerated (lines 215-221), using the flag prevents unnecessary errors and maintains consistency with the fix.🔧 Proposed fix
- ok, output = _run([sys.executable, '-m', 'pip', 'install', '--break-system-packages', str(rgbmatrix_path)]) + ok, output = _run([sys.executable, '-m', 'pip', 'install', '--break-system-packages', '--ignore-installed', str(rgbmatrix_path)])🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@scripts/install_dependencies_apt.py` at line 211, The rgbmatrix pip install command at the _run() call for installing from rgbmatrix_path is missing the --ignore-installed flag. Add --ignore-installed to the pip command arguments (between 'install' and '--break-system-packages') to maintain consistency with the main install_via_pip() function and prevent unnecessary pip failures when upgrading apt-managed dependencies.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@scripts/install_dependencies_apt.py`:
- Line 211: The rgbmatrix pip install command at the _run() call for installing
from rgbmatrix_path is missing the --ignore-installed flag. Add
--ignore-installed to the pip command arguments (between 'install' and
'--break-system-packages') to maintain consistency with the main
install_via_pip() function and prevent unnecessary pip failures when upgrading
apt-managed dependencies.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: ff536e14-8ad1-4b03-821a-129814d5fe8b
📒 Files selected for processing (1)
scripts/install_dependencies_apt.py
Keeps the rgbmatrix pip install consistent with install_via_pip so it won't fail trying to uninstall an apt-managed dependency either. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Good catch @coderabbitai — applied Reminder for reviewers: per the PR note, this is still untested on a fresh Pi install — it's reasoned from the Discord error, not reproduced. |
|
Tip For best results, initiate chat on the files or code changes.
Good call flagging the "reasoned, not reproduced" status for reviewers. If someone can spin up a fresh Raspberry Pi OS image to do an end-to-end smoke test before merge, that would be the ideal validation path for both the main (ᵔ◡ᵔ)🐇 |
Note
Untested on a fresh install. This PR is Claude's interpretation of an issue raised in Discord (a fresh Pi install failing at step 7). The reasoning and fix are explained below, but I have not reproduced the failure or verified the fix on a clean Raspberry Pi OS image. Please review/test before merging.
Problem
On a fresh Raspberry Pi install, step 7 ("Install web interface dependencies") aborts with:
Why it happens
install_dependencies_apt.pyinstallsrequestsvia apt →python3-requests(2.32.3). Debian-packaged Python modules ship no pipRECORDfile.google-api-python-client. Its dependency tree pulls a newerrequests, and pip's resolver tries to uninstall the apt copy to replace it.uninstall-no-record-file→ the whole install aborts.Fix
Add
--ignore-installedtoinstall_via_pip. pip then installs the new version into/usr/local/lib/.../dist-packages(which shadows the apt copy on Debian) instead of trying to remove the apt-managed package. This resolves the failure for any transitive dependency pip needs to upgrade over an apt-installed package, not justrequests.Manual workaround (for anyone hitting this now)
Testing
Byte-compiled and functionally verified that
install_via_pipnow emits--break-system-packages --prefer-binary --ignore-installed. Not validated end-to-end on a fresh Pi image (see note above).🤖 Generated with Claude Code
Summary by CodeRabbit