Python Packages Skill
Installation Pattern
Containers run as root. Always use --break-system-packages:
bashpip3 install --break-system-packages <package>
Common Packages by Category
Data Analysis
bashpip3 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
bashpip3 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
bashpip3 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
bashpip3 install --break-system-packages requests beautifulsoup4 lxml
Geospatial & Domain-Specific
bashpip3 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:
bashpip3 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


