name: python-packages description: Installing and using common Python packages in SkillBench containers. Covers scientific computing, data analysis, and file format libraries.
Python Packages Skill
Installation Pattern
Containers run as root. Always use --break-system-packages:
pip3 install --break-system-packages <package>
Common Packages by Category
Data Analysis
pip3 install --break-system-packages pandas numpy openpyxl xlsxwriter
pandas: DataFrames, CSV/Excel/JSON I/Onumpy: Numerical arrays, linear algebra, statisticsopenpyxl: Read/write Excel .xlsx filesxlsxwriter: Write Excel with formatting
Scientific Computing
pip3 install --break-system-packages scipy scikit-learn matplotlib
scipy: Optimization, interpolation, signal processing, statisticsscikit-learn: ML models, preprocessing, metricsmatplotlib: Plotting (useAggbackend:import matplotlib; matplotlib.use('Agg'))
File Formats
pip3 install --break-system-packages python-pptx python-docx Pillow PyPDF2 pyyaml
python-pptx: PowerPoint filespython-docx: Word documentsPillow: Image processingPyPDF2orpypdf: PDF readingpyyaml: YAML parsing
Web & APIs
pip3 install --break-system-packages requests beautifulsoup4 lxml
Geospatial & Domain-Specific
pip3 install --break-system-packages shapely geopandas # GIS
pip3 install --break-system-packages obspy # Seismology
pip3 install --break-system-packages rdkit-pypi # Chemistry (may need conda)
pip3 install --break-system-packages astropy # Astronomy
Pre-installed Check
Before installing, check what's available:
pip3 list 2>/dev/null | head -40
python3 -c "import pandas; print(pandas.__version__)" 2>/dev/null
Common Issues
- matplotlib backend: Set
matplotlib.use('Agg')before importing pyplot - Missing C libraries:
apt-get update && apt-get install -y libgdal-devfor geopandas - Compilation: Some packages need
gcc:apt-get install -y build-essential - Timeout: Large packages (torch, tensorflow) may timeout — check if pre-installed first