Skip to content

Fix bin/plexadm to use venv site-packages when available#15

Merged
jasmeralia merged 1 commit into
masterfrom
fix/bin-venv-site-packages
May 19, 2026
Merged

Fix bin/plexadm to use venv site-packages when available#15
jasmeralia merged 1 commit into
masterfrom
fix/bin-venv-site-packages

Conversation

@jasmeralia

Copy link
Copy Markdown
Owner

Summary

  • On Linux, the venv Python is typically a symlink back to the system Python binary, so os.execv with the venv Python is a no-op and the venv's site-packages never appears on sys.path
  • This caused ModuleNotFoundError: No module named 'dotenv' when running bin/plexadm directly (without activating the venv), because python-dotenv is only installed in the venv
  • Fix: explicitly insert the venv's site-packages directory at the start of sys.path before any imports

Test plan

  • bin/plexadm list renames "TUSHY" works without activating the venv
  • make lint passes clean

🤖 Generated with Claude Code

When the venv Python symlinks back to the system Python (common on Linux),
os.execv re-exec is a no-op and the venv's site-packages never land on
sys.path. Explicitly insert the venv's site-packages directory so
dependencies like python-dotenv are found without requiring a system-wide
install or manual venv activation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jasmeralia jasmeralia merged commit a607cf4 into master May 19, 2026
1 check passed
@jasmeralia jasmeralia deleted the fix/bin-venv-site-packages branch May 19, 2026 13:53
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

Successfully merging this pull request may close these issues.

1 participant