You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何更新包哈希?Win10下Anaconda安装kwant遇哈希不匹配问题求助

Fixing Kwant Installation Hash Mismatch on Anaconda 3-5.1.0 (Windows 10)

Hey there, let's walk through solving this hash mismatch error you're getting when installing Kwant via pip. I've dealt with similar issues on Windows with Anaconda, so here are the practical steps to get it working:

  • First, confirm you're using the right pip
    Make sure you're using the pip bundled with your Anaconda environment, not the system-wide pip. Activate your Anaconda environment first (if you're using the base env, run conda activate base), then verify with:

    pip --version
    

    The output should show a path inside your Anaconda installation folder—this ensures you're installing into the correct environment with the pre-installed scipy and numpy.

  • Clear pip's cache and install the local .whl directly
    Hash mismatches often stem from pip having a cached package version that doesn't match. Clear the cache first:

    pip cache purge
    

    Then install the exact .whl file you downloaded, specifying its full or relative path. For example, if it's in your Downloads folder:

    pip install C:\Users\YourName\Downloads\kwant-1.3.2-cp36-cp36m-win_amd64.whl
    

    Installing directly from the local file skips PyPI's hash check entirely, which eliminates the mismatch error.

  • Verify compatible scipy/numpy versions
    Kwant 1.3.2 has specific dependency requirements for numpy and scipy. Check your current versions with:

    conda list scipy numpy
    

    If your versions are too old or new, adjust them to compatible ones (for Python 3.6, numpy >=1.13 and scipy >=0.19 work well). Use conda to update/downgrade:

    conda install numpy=1.16 scipy=1.2
    

    This ensures the dependencies align with what Kwant expects.

  • If all else fails, disable cache for the install
    If you still run into issues, try installing with the --no-cache-dir flag to force pip to ignore any cached files:

    pip install ./kwant-1.3.2-cp36-cp36m-win_amd64.whl --no-cache-dir
    

    This is a quick fix for persistent cache-related hash problems.

Just remember to run all these commands with your Anaconda environment activated—this avoids conflicts with system packages.

内容的提问来源于stack exchange,提问作者aminoffline

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.27 03:34:50