Packages are workflows, not a single domain

In 2026, people still summarize “slow pip” as if the entire toolchain spoke to exactly one polite server. Reality is dirtier for both pip and conda. The client negotiates manifests, parses JSON, resolves hashes, performs range requests across CDNs or storage edges, retries after redirects, sometimes reaches GitHub Releases mirrors, sometimes hits a deliberate regional PyPI mirror you configured—or forgot you inherited from a Dockerfile. Meanwhile Clash evaluates your Mihomo YAML in strict order until the first winner matches. If ninety percent of the bytes live on sibling hostnames that never earned explicit DOMAIN lines while the index host did, congratulations: you just proxied the pamphlet while the forklift sat under the wrong hoist.

That mismatch is precisely why installs “stall” despite a green Connected badge. The stalled phase is rarely the login page you checked in Chromium. It can be chunked wheel downloads, conda’s Solver phase waiting on saturated links, TLS handshakes to an exit that your subscription recycles aggressively during long PUT-like sessions, or a domestic mirror accidentally riding a faraway node because GEOIP shouted first. Compared with narrowly scoped developer-AI tooling articles, generic Python package management routing deserves its own playbook: you optimize for repeatable scientific dependency graphs, conda channels, nightly wheels—not only chat APIs.

If policy vocabulary feels foreign, skim the Clash official home overview first, then read the custom routing beginner guide so terminology below matches YAML you actually write.

Map four traffic families before you rotate nodes

Forget memorizing brittle host lists scraped from Reddit; capture your own Mihomo logs while reproduction runs. Nonetheless, think in reproducible buckets.

PyPI index and simple endpoints. Tools talk to whichever base URL satisfies PEP 503 semantics—default files.pythonhosted.org for artifacts often pairs with metadata under pypi.org or your mirror’s domain. Routing only one of those while the resolver still points browsers at stale DNS kills half the story.

conda / Miniconda / conda-forge repodata lanes. Whether you pinned defaults, conda-forge, or a corporate mirror, conda requests channel metadata and huge compressed blobs that may live on noticeably different CDN patterns than upstream PyPI. Treat Anaconda CDN shaped traffic as throughput-sensitive; cold metadata calls may crave lower latency.

GitHub Release and auxiliary fetch paths. Many scientific wheels originate from github.com Releases, objects.githubusercontent.com, raw.githubusercontent redirects, occasionally Amazon S3 or Azure blob SNIs surfaced only after a 302. Cursor marketplace articles overlap here; we focus on unattended CLI downloads instead of IDE UI latency.

Domestic mirrors and enterprise caches. Teams often point PIP_INDEX_URL / CONDA_REPO-style knobs at geographically close mirrors. Putting those hostnames behind the same offshore exit as your geopolitical browsing multiplies throughput loss for no cryptographic benefit. Sometimes you willingly choose DIRECT domestic when policy allows—the rules must encode that consciously.

Name policy groups for throughput versus metadata

Concrete starting names help collaboration: PYPI_INDEX for PEP 503 top-level lookups, PYPI_BLOB for heavyweight file payloads, CONDA_CDN for repodata blobs and channel artifacts matching your captures, GITHUB_REL for GitHub Releases families, optional MIRROR_DIRECT if you purposely bypass tunnel for compliant domestic mirrors.

Within groups, articulate intent. PYPI_BLOB favors exits that tolerate long TCP downloads without jittery chain switching. PYPI_INDEX may reward snappy handshake if your resolver hops frequently. Mixed expectations inside one overloaded “Proxies” group waste hours tweaking subscription order when YAML semantics were the bottleneck.

Readers comparing with terminal OpenAI tooling may glance at our Codex CLI split-routing companion, yet please do not blindly paste those domain bundles—pypi and conda host graphs differ entirely.

Place explicit DOMAIN-SUFFIX lines ahead of GEOIP roulette

Clash kernels accept the earliest matching rule. Remote RULE-SET blobs and GEOIP directives are ergonomic until they beat your carefully handwritten lines. Promote narrowly scoped snippets above them.

Prefer DOMAIN-SUFFIX,pypi.org,PYPI_INDEX style entries only after validating real SNIs in your environment. Follow with storage patterns you genuinely observed—for example CDN edges under pythonhosted—or else your manifests route correctly while payloads hit DIRECT through asymmetric ISP shaping.

Avoid careless DOMAIN-KEYWORD,git globs—they age poorly when unrelated Git-hosted resources collide. Maintain remote lists through the workflow in the advanced rule-provider guide so curated overrides resist subscription churn drowning them.

When diagnosing half-open QUIC streams during large downloads, QUIC troubleshooting remains relevant—not every stall is ICMP loss; sometimes UDP-shaped paths rot while TCP fallback succeeds.

Why “connected” hides silent DIRECT defeats

Most frustrating timeouts read generically—“Read timed out” or “conda exit code nonzero”—masking contradictory routing halves. Scenario sketch: resolves and simple API calls traverse polished proxy transports while chunked wheel fetch fell through GEOIP CN DIRECT, hammering asymmetric cross-border congestion. Another angle: conda metadata flows through unstable nodes while blobs accidentally remain domestic because subdomain coverage differed.

Keep deterministic ordering habits: enumerated inline DOMAIN rules for tooling families → curated RULE-SET tiers → GEOIP fallback → deliberate MATCH. If a community GEOIP snippet wins prematurely, rewriting group names wastes keystrokes forever.

When entire stacks feel vaguely offline despite Mihomo asserting success, widen scope with our connected-but-dead-pages diagnostic map—resolver drift still ambushes unattended daemons relying on systemd-resolved or macOS stubs.

A deliberately incomplete YAML scaffold

Copy nothing blindly. Harmonize placeholders with proxies you physically control, annotate discovered SNIs, position this block upstream of GEOIP lumps.

# Example scaffold — suffixes illustrative; reconcile with Mihomo logs.
proxy-groups:
  - name: PYPI_INDEX
    type: select
    proxies:
      - stable-metadata
      - failover-pair
      - DIRECT
  - name: PYPI_BLOB
    type: select
    proxies:
      - throughput-a
      - throughput-b
      - DIRECT
  - name: CONDA_CDN
    type: select
    proxies:
      - throughput-a
      - throughput-b
      - DIRECT
  - name: GITHUB_REL
    type: select
    proxies:
      - stable-general
      - DIRECT

rules:
  - DOMAIN-SUFFIX,pypi.org,PYPI_INDEX
  - DOMAIN-SUFFIX,pythonhosted.org,PYPI_BLOB
  # conda / channel CDN hostnames surfaced in failures:
  # - DOMAIN-SUFFIX,anaconda.com,CONDA_CDN
  # - DOMAIN-SUFFIX,conda-forge.org,CONDA_CDN
  # GitHub release families verified in capture:
  - DOMAIN-SUFFIX,github.com,GITHUB_REL
  - DOMAIN-SUFFIX,githubusercontent.com,GITHUB_REL
  - MATCH,GLOBAL_FALLBACK

Note comments: conda channels often unveil multiple suffix families; expand until large .conda extractions stabilize. Mirrors sometimes warrant entire dedicated groups terminating in DIRECT when compliance demands domestic paths—document intent inline so automation does not prune them as “duplicate.”

HTTP_PROXY, conda activation, shells, and systemd

Even perfect YAML fails when pip inherits environment variables pointing at old ports—or none at all. Mihomo exposes mixed HTTP/SOCKS listeners; conda env scripts may wipe inherited exports on activation hooks. Jupyter kernels launched from systemd units might lack profile sourcing entirely.

Standard approach: unify HTTP_PROXY, HTTPS_PROXY, lowercase variants, optionally ALL_PROXY for SOCKS, plus careful NO_PROXY exclusions for LAN PyPI caches. Inspect both login shells versus non-login shells—the macOS mismatch stories we unpacked in macOS Terminal proxy environment troubleshooting apply equally to conda users whose .zprofile silently diverges from .zshrc.

Windows plus WSL2 amplify chaos: conda inside Linux ignores Windows UI proxy assumptions; align Windows host IPs, Mihomo LAN exposure, mirrored env exports, revisit resolve.conf interactions when fake-ip quirks appear (see dedicated WSL2 route articles if bridging across OS boundaries).

Remember REQUESTS_CA_BUNDLE or conda SSL knobs only after routing correctness—you cannot certify MITM tooling before plain TLS paths succeed.

Mirrors versus foreign exits intentionally

Educational institutes sometimes mandate domestic mirrors honoring acceptable-use policies—route them DIRECT, not through premium offshore pools squandering quotas. Conversely, blindly forcing Chinese educational mirrors while your organization forbids unofficial caches courts supply-chain risk. Pick explicit outbound groups or DIRECT, document stakeholder approval, annotate YAML commit messages—not midnight Slack panic.

When conda errors mention repodata freshness, confirm whether routed mirrors MITM-signed metadata differently; mixing HTTP mirror endpoints with SOCKS upstream may trigger subtle TLS inspection conflicts.

DNS, fake-ip, and resolver schizophrenia

Split routing demands consistent answers. Mihomo DNS modes under fake-ip can diverge radically from systemd-resolved on the host. If the background daemon resolves files.pythonhosted.org differently than Mihomo interception expects, chunked downloads resume oddly or resume never—mirroring intermittent corruption symptoms.

Validate query pathways through whichever capture mode you orchestrate (tun-auto-route versus pure mixed-port env). Ping success from terminals does not refute divergence between Python’s resolver sockets and Mihomo internals. If conda claims “HTTP 000” pseudo-errors while urllib3 elsewhere succeeds, reconcile whether libcurl inside conda picked up corporate CA bundles contrasting with Mihomo interception—still a routing prerequisite before certificate drama matters.

Checklist operators can repeat nightly

  1. Reproduce failure with Mihomo verbose logging capturing SNIs co-temporal with user-visible freezes.
  2. Group each offender into PYPI-, conda-, GitHub-aligned buckets—not accidental MATCH leftovers.
  3. Compare IPv4 versus IPv6 for identical host; AS paths often diverge—toggle experiments cautiously respecting policy constraints.
  4. Strip stale env proxies: spawn fresh shells, deactivate conda temporarily, rerun minimal curl -Iv tests through intended listeners.
  5. After YAML edits, run controlled small-file index fetch plus multi-hundred-megabyte synthetic pull to differentiate metadata slowness from blob choke.
  6. For CI runners (GitHub Actions, GitLab Runner) bridging local caches, revisit runner-specific NO_PROXY quirks—beyond scope here but analogous misroutes appear.

Symptoms versus first inspectors

Observable symptom Inspect early
Requirement resolution prints quickly yet wheel download freezes single-digit percent Unmatched CDN/blob hostname routed differently than metadata; expand DOMAIN coverage; QUIC path
conda solves environment then hangs fetching large .conda/.tar.bz2 CDN group mismatch versus index; IPv6 divergence; throughput node thrashing
Installing from GitHub wheel links fails while HTTPS curl to raw works manually Redirects to object storage unnoticed; widen GitHub CDN families; authenticate tokens out-of-band routing
Mirrored domestic index slow only when Mihomo captures everything GEOIP overriding explicit mirror lines; purposeful DIRECT or dedicated domestic group lacking
Interactive shell inherits proxy but Jupyter kernel does not systemd or launchd stripped env exports; unify activation hooks exporting proxy vars
Adopt log-first triage: one stalled conda install, one captured SNI CSV, diff against YAML. If the offending hostname truly never landed in rule text, rewriting subscription node names will not unblock anything.

Scope, ethics, and acceptable use

Organizations publish routing guidance to troubleshoot infrastructure within policy. Abusing unrestricted exits to circumvent institutional mirror mandates, contractual bandwidth caps, export controls, or software licensing regimes remains wrong even if technically feasible—this tutorial explains mechanics for authorized operators only.

Technology cannot replace upstream outages. When repositories declare widespread incidents, escalate through official status channels—not endless node roulette.

Closing: reinstall predictability inside your toolchain belt

Compared with monolithic GLOBAL toggles that treat every outbound byte identically, named groups for indexes, heavyweight blobs, channel CDNs, and GitHub payloads convert mysterious hour-long stalls into legible spreadsheets. Mihomo excels when narratives stay explicit—rules ordered intentionally, proxies chosen per workload families, proxies aligned with conda/pip realities instead of anecdotes.

If you crave that operational clarity bundled with approachable installers—not mandatory Git hunting—visit the Clash download page; packages sit on this domain first because predictable distribution matters as much as open-source repos.

→ Download Clash for free and experience the difference

Download Clash from this site