升级pip后无法安装dns模块,运行Electrum提示缺少该模块
I see exactly what's going on here—you're trying to install a package named dns, but the correct PyPI package for DNS functionality that Electrum relies on is called dnspython. That's why pip install dns is failing to find any matching distributions.
Step-by-Step Fix
- Install the correct package using Electrum's local pip to ensure it's installed in the right environment (since Electrum uses a self-contained setup):
~/electrum/pip install dnspython - Verify the installation by launching Electrum again:
~/electrum/python electrum
Why This Error Occurs
When you ran ~/electrum/python electrum, you got:
Error: No module named 'dns'. Try 'sudo pip install
'
The <module-name> here is a placeholder, but the actual package name isn't dns—PyPI doesn't host a package under that exact name. That's why your attempt to install it resulted in:
Collecting dns
Could not find a version that satisfies the requirement dns (from versions: )
No matching distribution found for dns
Additional Context
Based on your git log, you're running the latest master branch of Electrum (commit c8e67e2bd07efe042703bc1368d499c5e555f854), so this fix should apply directly. If you still encounter issues, double-check that you're using the pip and python executables located in your ~/electrum directory—system-wide package installations won't affect Electrum's isolated environment.
内容的提问来源于stack exchange,提问作者quantumpotato

