• <noscript id="ecgc0"><kbd id="ecgc0"></kbd></noscript>
    <menu id="ecgc0"></menu>
  • <tt id="ecgc0"></tt>

    如何將pip源更換到國內鏡像

    通常在cmd中直接pip安裝第三方包時速度總是很慢,有時候也會因網頁響應慢而下載失敗,因此本篇小編帶大家了解一下如何將pip源切換到國內鏡像,讓下載速度快起來。

    東西/原料

    • 電腦
    • python
    • cmd

    即用即改

    1. 1

      按下“win+r”進入運行界面,并輸入“cmd”,回車

    2. 2

      接下來在輸入“pip install xxx”時插入國內鏡像源地址,變為“pip install -i 地址 xxx”

      (幾個常用鏡像源:

      阿里云:http://mirrors.aliyun.com/pypi/simple/

      清華大學:https://pypi.tuna.tsinghua.edu.cn/simple/

      中國科學手藝大學:http://pypi.mirrors.ustc.edu.cn/simple/

    3. 3

      按上圖輸入,回車即可(圖中也能看到利用了清華的鏡像)

      END

    永遠點竄

    1. 1

      (此處是windows下的)

      在磁盤c下的用戶(當前登錄用戶即可)下新建pip文件夾

    2. 2

      進入pip文件夾,新建一個文本文檔,并將其名稱及擴展改為“pip.ini”

    3. 3

      以記事本的體例打開即可

    4. 4

      輸入下圖內容,保留

      [global]

      index-url = https://pypi.tuna.tsinghua.edu.cn/simple/


      [install]

      trusted-host = https://pypi.tuna.tsinghua.edu.cn


    5. 5

      此時從頭進入cmd,直接“pip install xxx”,可以看到此處仍是清華大學的鏡像源

      END
    • 發表于 2020-05-12 17:01
    • 閱讀 ( 1397 )
    • 分類:其他類型

    0 條評論

    請先 登錄 后評論
    admin
    admin

    0 篇文章

    作家榜 ?

    1. xiaonan123 189 文章
    2. 湯依妹兒 97 文章
    3. luogf229 46 文章
    4. jy02406749 45 文章
    5. 小凡 34 文章
    6. Daisy萌 32 文章
    7. 我的QQ3117863681 24 文章
    8. 華志健 23 文章

    聯系我們:uytrv@hotmail.com 問答工具
  • <noscript id="ecgc0"><kbd id="ecgc0"></kbd></noscript>
    <menu id="ecgc0"></menu>
  • <tt id="ecgc0"></tt>
    久久久久精品国产麻豆