Overview
Grupo de Anda projects use various Python libraries for AI, audio processing, GUI development, and more. This guide covers installing and managing these dependencies.Required Dependencies
The Grupo de Anda projects use the following Python libraries:Library Overview
| Library | Purpose |
|---|---|
| customtkinter | Modern GUI framework for Python applications |
| keyboard | Keyboard event handling and hotkeys |
| gpt4all | Local AI model integration |
| requests | HTTP requests for API calls |
| llama-cpp-python | Llama model inference |
| gTTS | Google Text-to-Speech |
| pygame | Audio playback and game development |
| torch | PyTorch deep learning framework |
| librosa | Audio analysis and processing |
| numpy | Numerical computing |
| sounddevice | Audio recording and playback |
| pydub | Audio file manipulation |
Installation Steps
Install All Dependencies
Install all required libraries at once:
This may take several minutes as some packages (especially PyTorch) are quite large.
Installing Individual Packages
If you prefer to install packages one at a time or only need specific libraries:GUI Development
AI and Machine Learning
Audio Processing
Utilities
API Configuration
Some features require API keys or external services:If the code you want to run uses AI models that require an API, you’ll need to obtain the appropriate API key.
Google Gemini API
- Endpoint:
https://generativelanguage.googleapis.com/ - Use: AI model integration
- Get your API key from Google AI Studio
Google Text-to-Speech API
- Endpoint:
https://translate.google.com/translate_tts - Use: Text-to-speech conversion
- Used by the gTTS library (no API key needed for basic usage)
How to configure API keys
How to configure API keys
API keys are typically configured in environment variables or configuration files:Environment Variable:Configuration File:
Create a
.env file or config file as specified by the specific project.Dependency Management
Creating requirements.txt
To save your current dependencies:Installing from requirements.txt
If the project includes arequirements.txt file:
Platform-Specific Notes
Ubuntu/Linux
Some packages may require system dependencies:Windows
- Most packages install without issues
- PyTorch may require Visual C++ Redistributable
- Some audio libraries may need additional setup
macOS
- Install Homebrew first for system dependencies
- May need Xcode Command Line Tools:
PyTorch Installation
PyTorch is a large package with different installation options:CPU-Only (Smaller, Faster Download)
GPU Support (CUDA)
For NVIDIA GPU acceleration:The basic
pip install torch command installs the CPU version. For GPU training and inference, use the CUDA version appropriate for your system.Updating Dependencies
Update a Single Package
Update All Packages
Running the Code
After installing dependencies:Troubleshooting
ModuleNotFoundError: No module named 'X'
ModuleNotFoundError: No module named 'X'
The package isn’t installed. Install it:Make sure your virtual environment is activated.
Permission denied error
Permission denied error
Ubuntu: Never use
sudo pip. Use a virtual environment instead.Windows: Run your terminal as administrator, or use virtual environments (recommended).PyTorch installation is very slow
PyTorch installation is very slow
PyTorch is a large package (several GB). The download takes time depending on your internet connection.For a smaller install, use CPU-only:
Package version conflicts
Package version conflicts
Try creating a fresh virtual environment:
Audio libraries not working
Audio libraries not working
Linux: Install system audio dependencies:Windows: Install Visual C++ Redistributable from Microsoft.macOS: Install portaudio via Homebrew:
gpt4all or llama-cpp-python build errors
gpt4all or llama-cpp-python build errors
These packages require compilation. Install build tools:Ubuntu:Windows: Install Visual Studio Build ToolsmacOS: Install Xcode Command Line Tools:
Next Steps
With dependencies installed, you can:- Set up Arduino hardware (for hardware projects)
- Start running the Grupo de Anda projects
- Explore the AI model training in the
ai creatorfolder
Additional Resources
AI Model Training
In the
ai creator folder, you’ll find AI model training code. You can:- Use existing training data
- Add your own data for training
- Configure to use CPU, GPU, or both for improved performance
Supported AI Commands
The trained models support these commands:search=[tema]- AI searches the internet for a topicclma=[lugar]- AI provides climate data for a specific regionubicacion=[]- Provides location data to the AI
Intent Detection
The intent detection model recognizes:investigar(research)clima(weather/climate)conversacion_ai(AI conversation)
