Scientific Python
The scientific Python world has its own packaging history — conda, pixi, CUDA wheels, and large binary dependencies. The handbook explains where uv fits, when conda or pixi are still the right call, and how to install ML packages reliably.
Get started with data science tooling
GPU and ML workflows
Migrate to modern tools
More Scientific Python pages
Everything else tagged scientific-python, grouped by section. Pages featured above are not repeated here.
How To
How to Deploy a uv Project to Hugging Face Spaces
Deploy a uv project to Hugging Face Spaces for a free, public app. Handles gradio integration and secrets.
How to Fix ModuleNotFoundError: No module named 'numpy' When Building a Package with pip
Fix ModuleNotFoundError by declaring build-time dependencies in pyproject.toml or using pip install --no-build-isolation as a quick workaround.
How to Ignore a Dependency in Dependabot Without Blocking Its Security Updates
Scope a Dependabot ignore rule to version updates so a pinned package stops routine PRs but still gets security fixes.
How to Install CUDA PyTorch Wheels Without a GPU
Declare the target CUDA driver version so uv resolves GPU PyTorch wheels on a build machine that has no GPU installed.
How to Install DeepSpeed
Install DeepSpeed from a prebuilt wheel on the Astral GPU index instead of compiling its CUDA ops from source.
How to Install Flash-Attention
Install Flash-Attention prebuilt wheels with uv to skip CUDA compilation. Route torch and flash-attn to GPU indexes for instant ML environment setup.
How to Install Hugging Face Transformers with uv
Install Hugging Face Transformers with uv for CPU inference, GPU training with CUDA, or quantized model loading with accelerate and bitsandbytes.
How to Install JAX with uv
Install JAX for CPU, NVIDIA GPU (CUDA 12/13), or Google TPU with uv. JAX uses pip extras; no custom index configuration needed.
How to Install llama-cpp-python
Install llama-cpp-python with GPU acceleration for CUDA or Metal, using prebuilt wheels or compiling from source.
How to Install Triton
Install Triton GPU compiler for custom kernel development on Linux. Works standalone or as a PyTorch dependency for GPU optimization.
How to Install xformers
Install Meta's xformers library with the correct PyTorch and CUDA versions using pip, uv, or conda-forge.
How to Migrate from conda to uv
Convert a conda environment to a uv project with pyproject.toml and uv.lock for reproducible installs that finish in seconds.
How to Package Python Projects with Native Extensions
Build and check sdists and platform wheels for Python projects that ship C, C++, or Rust extension modules.
How to Publish a Python Package to conda-forge
Generate a conda recipe with grayskull, submit it to conda-forge staged-recipes, and inherit a bot-maintained feedstock for your PyPI package.
How to Run a Jupyter Notebook with uv
Run Jupyter with uv: launch a temporary session with one command, or add it to a project for reproducible notebooks.
How to run uv on Modal
Build Modal images from a uv.lock with uv_sync, install ad-hoc packages with uv_pip_install, and run the synced environment on a GPU.
How to Serve LLMs Locally with vLLM and uv
Install vLLM with uv for local LLM serving and inference. NVIDIA CUDA GPU acceleration. OpenAI-compatible API endpoints.
How to Use marimo with uv
Run marimo notebooks with uv: sandboxed PEP 723 notebooks, ad-hoc uvx sessions, and project environments.
Explanation
How do uv and conda compare?
uv and conda solve different problems: uv installs PyPI wheels fast, conda manages cross-language binaries like CUDA and GDAL.
Is Conda actually free?
conda and conda-forge are free and open source. Anaconda's commercial repository requires a license for organizations with over 200 employees.
Understanding the Conda/Anaconda Ecosystem
How conda, Miniconda, Anaconda, and conda-forge fit together as a language-agnostic package management ecosystem for scientific computing.
What Are Wheel Variants?
Wheel variants (PEP 817/825): ship hardware-specific builds under one wheel name. Let installers detect CPU, GPU, and pick the best.
Why should I choose Conda?
Conda manages non-Python dependencies that pip cannot, making it the right choice when your project depends on compiled libraries across languages.
Reference
Anaconda
Anaconda Distribution is a Python and R data science platform bundling conda, pre-installed scientific libraries, and GUI tools.
Conda
conda is a language-agnostic package and environment manager used primarily in scientific computing and data science.
Conda Package
A conda package is a compressed archive containing pre-built binaries, metadata, and dependency information for distribution through conda channels.
conda-forge
conda-forge is a free community conda channel with 25,000+ packages, faster updates, and no licensing restrictions for commercial use.
conda-pypi
conda-pypi is a conda plugin that installs PyPI packages into conda environments, tracked by conda's solver alongside native conda packages.
marimo
Reactive Python notebook as a .py file. Cells re-run when inputs change. PEP 723 metadata lets uv run in isolated environments.
pixi
Package manager combining conda-forge and PyPI for native dependencies. CUDA, scientific libraries, and mixed-language projects with lockfiles.
Positron
Positron is a free IDE for data science and ML, built on VS Code. Integrates Python, R, and Quarto workflows.
From the blog
Posts tagged scientific-python.
-
Pixi Can Now Build Packages From Source
Pixi Build brings PEP 517-style build backends to the conda ecosystem, letting pixi build Python, Rust, and mixed-language packages from source inside a single project. SciPy, Xarray, Dask, and CPython are early adopters.
-
Your Python Wheels Still Target 2009 CPUs
The wheel format cannot describe a CPU's instruction set, so default wheels compile for the lowest common denominator. Wheel variants would end that.
-
In 2012, Guido Had No Idea NumPy Had Its Own Packaging System
A 2012 panel discussion between Guido van Rossum and the scientific Python community reveals how deep the disconnect on packaging ran.
-
One Line Command to Launch a Notebook with Pytorch
Launch a Jupyter notebook with PyTorch using a single uv run command that handles Python, dependencies, and isolation.
-
Scientific Python Library Development Guide
The Scientific Python Library Development Guide offers topical guides on packaging, GitHub Actions, and more for research software.