Skip to content

搞英语 → 看世界

翻译英文优质信息和名人推特

Menu
  • 首页
  • 作者列表
  • 独立博客
  • 专业媒体
  • 名人推特
  • 邮件列表
  • 关于本站
Menu

使用阿里云源加速pip安装包

Posted on 2024-01-05

使用pip 使用阿里云的源,可以通过以下两种方法:

方法一:使用pip命令行参数

在使用 pip 命令安装包时,可以使用-i参数指定源地址。例如,要使用阿里云源安装包,可以使用以下命令:

 pip install -i https://mirrors.aliyun.com/pypi/simple/ package_name

例如,要安装pandas包,可以使用以下命令:

 pip install -i https://mirrors.aliyun.com/pypi/simple/ pandas

方法二:修改pip配置文件

也可以修改pip配置文件来设置源地址。在Linux和macOS系统中,pip配置文件位于~/.pip/pip.conf文件中。在Windows系统中,pip配置文件位于%HOMEPATH%\pip\pip.ini文件中。

要使用阿里云源,需要在配置文件中添加以下内容:

 [global] index-url = https://mirrors.aliyun.com/pypi/simple/

例如,在 Linux 或 macOS 系统中,可以使用以下命令修改配置文件:

 echo "[global]" >> ~/.pip/pip.conf echo "index-url = https://mirrors.aliyun.com/pypi/simple/" >> ~/.pip/pip.conf

在Windows系统中,可以使用以下命令修改配置文件:

 echo "[global]" > %HOMEPATH%\pip\pip.ini echo "index-url = https://mirrors.aliyun.com/pypi/simple/" >> %HOMEPATH%\pip\pip.ini

原文: https://atlassc.net/2024/01/05/pip-aliyun

本站文章系自动翻译,站长会周期检查,如果有不当内容,请点此留言,非常感谢。
  • Abhinav
  • Abigail Pain
  • Adam Fortuna
  • Alberto Gallego
  • Alex Wlchan
  • Answer.AI
  • Arne Bahlo
  • Ben Carlson
  • Ben Kuhn
  • Bert Hubert
  • Bits about Money
  • Brian Krebs
  • ByteByteGo
  • Chip Huyen
  • Chips and Cheese
  • Christopher Butler
  • Colin Percival
  • Cool Infographics
  • Dan Sinker
  • David Walsh
  • Dmitry Dolzhenko
  • Dustin Curtis
  • Elad Gil
  • Ellie Huxtable
  • Ethan Marcotte
  • Exponential View
  • FAIL Blog
  • Founder Weekly
  • Geoffrey Huntley
  • Geoffrey Litt
  • Greg Mankiw
  • Henrique Dias
  • Hypercritical
  • IEEE Spectrum
  • Investment Talk
  • Jaz
  • Jeff Geerling
  • Jonas Hietala
  • Josh Comeau
  • Lenny Rachitsky
  • Liz Danzico
  • Lou Plummer
  • Luke Wroblewski
  • Matt Baer
  • Matt Stoller
  • Matthias Endler
  • Mert Bulan
  • Mostly metrics
  • News Letter
  • NextDraft
  • Non_Interactive
  • Not Boring
  • One Useful Thing
  • Phil Eaton
  • Product Market Fit
  • Readwise
  • ReedyBear
  • Robert Heaton
  • Ruben Schade
  • Sage Economics
  • Sam Altman
  • Sam Rose
  • selfh.st
  • Shtetl-Optimized
  • Simon schreibt
  • Slashdot
  • Small Good Things
  • Taylor Troesh
  • Telegram Blog
  • The Macro Compass
  • The Pomp Letter
  • thesephist
  • Thinking Deep & Wide
  • Tim Kellogg
  • Understanding AI
  • 英文媒体
  • 英文推特
  • 英文独立博客
©2025 搞英语 → 看世界 | Design: Newspaperly WordPress Theme