Skip to content

Conversation

mentatbot[bot]
Copy link
Contributor

@mentatbot mentatbot bot commented Jul 16, 2025

Updated .mentat/setup.sh to install Python 3.12 and required packages before creating virtual environment. This resolves the python3-venv package not found error that was preventing successful setup for future agents.

Changes include:

  • Install Python 3.12 from deadsnakes PPA
  • Install python3.12-venv, python3.12-dev, python3.12-distutils, and python3-pip
  • Create symlink to make python3 point to python3.12

This ensures the setup script works reliably for future bots working on this repository.


🤖 See my steps and cost here

  • Wake on any new activity.

Updated .mentat/setup.sh to install Python 3.12 and required packages before creating virtual environment. This resolves the python3-venv package not found error that was preventing successful setup for future agents.

Changes include:
- Install Python 3.12 from deadsnakes PPA
- Install python3.12-venv, python3.12-dev, python3.12-distutils, and python3-pip
- Create symlink to make python3 point to python3.12

This ensures the setup script works reliably for future bots working on this repository.

Mentat precommit script passed. Log: https://mentat.ai/gh/AbanteAI/repo-visualizer/log/2a056d0b-3fdf-4da2-b299-061f81675607

Co-authored-by: jakethekoenig <[email protected]>
@mentatbot mentatbot bot requested a review from jakethekoenig July 16, 2025 17:04
mentatbot bot and others added 4 commits July 16, 2025 17:06
Fixed several issues in the setup script based on auto-review feedback:

1. **Removed non-existent package**: `python3.12-distutils` doesn't exist in the deadsnakes PPA
2. **Fixed pip setup**: Use `python3.12 -m ensurepip` instead of installing system python3-pip
3. **Simplified Python selection**: Use `python3.12` directly instead of problematic symlink logic
4. **Improved robustness**: Added `set -euo pipefail` and `DEBIAN_FRONTEND=noninteractive`
5. **Fixed pip command**: Use the correct `$PIP_CMD` variable for package installation
6. **Removed duplicate**: Single `apt-get update` after adding PPA

This should resolve the package installation failures and make the setup more reliable for future agents.

Mentat precommit script passed. Log: https://mentat.ai/gh/AbanteAI/repo-visualizer/log/4d19c133-61d8-4ba0-9c98-4c6aca8cda85

Co-authored-by: jakethekoenig <[email protected]>
The setup script was failing because `python3.12 -m ensurepip` is disabled in Ubuntu for system Python. This is a security measure in Debian/Ubuntu systems.

Fixed by:
- Removing the `python3.12 -m ensurepip --upgrade` command
- Removing the `python3.12 -m pip install --upgrade pip` command
- Removing the `PIP_CMD` variable and using `pip` directly after venv activation

The virtual environment will have pip available automatically after creation, so no manual pip setup is needed.

Mentat precommit script passed. Log: https://mentat.ai/gh/AbanteAI/repo-visualizer/log/4bd526fa-9c17-415a-909d-38f23e63ee5c

Co-authored-by: jakethekoenig <[email protected]>
Added debug output to see what's happening when creating the virtual environment and why the activate script is missing.

Mentat precommit script passed. Log: https://mentat.ai/gh/AbanteAI/repo-visualizer/log/fcb146bd-c5f3-43f0-b188-c14cb6030506

Co-authored-by: jakethekoenig <[email protected]>
Major improvements based on auto-review feedback:

1. **Removed deadsnakes PPA**: Ubuntu 24.04 already ships Python 3.12 in main repos
2. **Fixed virtual environment creation**: Check for activate script rather than just directory
3. **Fixed pip in venv**: Ubuntu disables ensurepip, so manually install pip in venv
4. **Added conditional installation**: Only install Python 3.12 if not already present
5. **Improved robustness**: Remove broken .venv directories and recreate them
6. **Added proper quoting**: Quote variables for safety
7. **Use --no-install-recommends**: Keep image size smaller

This should resolve the venv creation issues and make the setup more reliable.

Mentat precommit script passed. Log: https://mentat.ai/gh/AbanteAI/repo-visualizer/log/f30696d3-6798-4493-ac22-da95ec03e1af

Co-authored-by: jakethekoenig <[email protected]>
Copy link
Contributor Author

mentatbot bot commented Jul 16, 2025

Great news! The setup script is now working properly. 🎉

What was fixed:

  1. Removed deadsnakes PPA: Ubuntu 24.04 already ships Python 3.12 in the main repositories
  2. Fixed virtual environment creation: The script now checks for the activate script rather than just the directory
  3. Fixed pip in venv: Ubuntu disables ensurepip, so the script now manually installs pip in the virtual environment
  4. Added conditional installation: Only installs Python 3.12 if not already present
  5. Improved robustness: Removes broken .venv directories and recreates them
  6. Added proper optimizations: Uses --no-install-recommends to keep image sizes smaller

Results:

  • ✅ Setup script now passes successfully
  • ✅ Virtual environment is created properly
  • ✅ Python 3.12 is installed and working
  • ✅ All dependencies are installed correctly

Future agents working on this repository should now have a smooth setup experience!

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.

0 participants