Skip to content

Conversation

@X9X0
Copy link
Owner

@X9X0 X9X0 commented Nov 16, 2025

Fixed the launcher to gracefully handle fresh Ubuntu 24.04 installations where pip is not installed by default.

Changes to lablink.py:

  • Added check_and_install_pip() bootstrap function
  • Checks for pip availability before trying to install PyQt6
  • Provides clear, formatted error messages with instructions
  • Handles pip installation failures gracefully
  • Suggests virtual environment as alternative approach
  • Better error formatting with visual separators

Changes to docs/UBUNTU_24.04_SETUP.md:

  • Added step-by-step explanation of first-run experience
  • Clarified what happens on each run (pip check → PyQt6 install → GUI)
  • Added TL;DR section for quick reference
  • Updated troubleshooting section with "pip is not installed" as first item
  • Added actual error message example for easy identification

User Experience Improvements:

  • Clear error messages instead of Python tracebacks
  • Specific instructions for Ubuntu 24.04 users
  • Alternative solutions (venv, manual install)
  • Visual formatting makes errors easy to understand

This fixes the issue where users on fresh Ubuntu 24.04 would see:
ModuleNotFoundError: No module named 'PyQt6'
CalledProcessError: Command returned non-zero exit status 1

Now they see:
ERROR: pip is not installed
On Ubuntu 24.04, install pip with:
sudo apt update
sudo apt install -y python3-pip python3-venv

Much clearer and actionable!

Fixed the launcher to gracefully handle fresh Ubuntu 24.04 installations
where pip is not installed by default.

Changes to lablink.py:
- Added check_and_install_pip() bootstrap function
- Checks for pip availability before trying to install PyQt6
- Provides clear, formatted error messages with instructions
- Handles pip installation failures gracefully
- Suggests virtual environment as alternative approach
- Better error formatting with visual separators

Changes to docs/UBUNTU_24.04_SETUP.md:
- Added step-by-step explanation of first-run experience
- Clarified what happens on each run (pip check → PyQt6 install → GUI)
- Added TL;DR section for quick reference
- Updated troubleshooting section with "pip is not installed" as first item
- Added actual error message example for easy identification

User Experience Improvements:
- Clear error messages instead of Python tracebacks
- Specific instructions for Ubuntu 24.04 users
- Alternative solutions (venv, manual install)
- Visual formatting makes errors easy to understand

This fixes the issue where users on fresh Ubuntu 24.04 would see:
  ModuleNotFoundError: No module named 'PyQt6'
  CalledProcessError: Command returned non-zero exit status 1

Now they see:
  ERROR: pip is not installed
  On Ubuntu 24.04, install pip with:
    sudo apt update
    sudo apt install -y python3-pip python3-venv

Much clearer and actionable!
@X9X0 X9X0 merged commit 6ee8e4d into main Nov 16, 2025
25 checks passed
X9X0 pushed a commit that referenced this pull request Nov 16, 2025
This commit fixes several critical issues in the launcher's apply_fixes method:

1. **Fix order of operations**: Sorts fixes by priority to ensure:
   - apt_install (system packages) runs first
   - ensurepip runs second (if needed)
   - create_venv runs third (after python3-venv is installed)
   - pip_install runs last (after venv exists)

2. **Add broken venv detection and recovery**: Before creating venv, checks
   if an existing venv is missing pip (broken). If so, removes and recreates it.

3. **Use venv pip for package installation**: When installing pip packages,
   uses venv/bin/pip if it exists, falls back to system pip otherwise.

4. **Add venv validation**: After creating venv, verifies that venv/bin/pip
   exists and provides helpful error message if not.

These changes fix the issues seen in the debug log where:
- Venv creation failed because python3-venv wasn't installed yet
- After apt install succeeded, venv/bin/pip didn't exist
- The launcher couldn't install server/client dependencies

Fixes #69
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.

3 participants