python3安装pip3
python运行错误
python报错ModuleNotFoundError: No module named 'httplib'
缺乏’httplib’包
pip install –upgrade pip`
响应
1 | Could not find a version that satisfies the requirement httplib (from versions: ) |
更新pip
1 | pip install --upgrade pip |
查看pip版本pip -V
1 | pip 19.1.1 from /usr/local/lib/python2.7/site-packages/pip (python 2.7) |
更新pip为pip3
1 | curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py |
错误解决
仍然报错ModuleNotFoundError: No module named 'httplib'
查找到stack overflow文章中指出You are running Python 2 code on Python 3. In Python 3, the module has been renamed to http.client.
这是python2的代码,不能用python3运行You could try to run the 2to3 tool on your code, and try to have it translated automatically. References to httplib will automatically be rewritten to use http.client instead.
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 螃蟹壳!