Python更换镜像源和安装jupyter

文章将解除你使用python的pip install xxx受到的网速限制,如果只是下载较小的第三方库,可以尝试pip --default-timeout=100 install -U xxx

找到python安装目录下的:\Lib\site-packages\pip\models\index.py文件,将PYPI的值改为你所需要的镜像源即可,例如改为豆瓣镜像源:

#PyPI = Index('https://pypi.python.org/')  
PyPI = Index('https://pypi.douban.com/')

安装jupyter

在命令行输入cmd,按回车键。将pip3 install jupyter输入,按回车键。待jupyter安装成功后,输入pip3 install jupyter_contrib_nbextensions,按回车键,带安装成功后,jupyter contrib nbextension install --user,按回车键,待程序执行结束后。在命令行输入powershell,按回车键。输入cd 空格+文档路径 ,按回车键。之后输入jupyter notebook,按回车键。之后jupyter会在浏览器中打开。