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會在瀏覽器中打開。