python:深入pip的安装源
python 的 pip是可以指定更新源的,具体操作如下
指定单次安装源
pip install SomePackage -i https://pypi.tuna.tsinghua.edu.cn/simple
指定全局安装源
在windows10上:
打开终端,输入 set,在输出的一大堆结果里面找:APPDATA=,然后打开这个目录,找pip文件夹,如果没有就创建一个,然后在这个文件夹里面创建一个名为pip.ini的文件,写入以下内容:
[global] timeout = 6000 index-url = https://pypi.tuna.tsinghua.edu.cn/simple
我用的是清华大学源。国内比较好用的源有:
pypi.python.org 官方源
pypi.douban.com 豆瓣源,福州
pypi.hustunique.com 华中科技大学源,武汉
pypi.tuna.tsinghua.edu.cn 清华源,北京

低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。
持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。
转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。
- 上一篇
python:好用的 with 语法
手动清理资源占用是个很痛苦的事情,比如刚学编程时候,老鸟就建议:写完open xxx 之后一定要写一个配对儿的 close,然后再往他俩中间写逻辑。 python 现在有个好玩的东西,利用上下文可以自动释放掉一个对象: class test(): def __init__(self,msg): print(msg) def __enter__(self): print('Enter Object test') def __exit__(self, exc_type, exc_val, exc_tb): print('Exit Object test') object=test('Hello') print('***head of code block***') with object as t: print('Did something here...') print('***end of code block***') 运行结果如下: Hello ***head of code block*** Enter Object test Did something here... Exit...
- 下一篇
python:关于pip
python pip安装包的一些常用命令: 1 罗列出所有安装过的包: pip list 或 pip freeze 2 安装包: 2.1 直接安装 $ pip install SomePackage # 默认最新版 $ pip install SomePackage==1.0.4 # 某个指定版 $ pip install 'SomePackage>=1.0.4' # 某个版本以上 2.2 从包列表文件里面依次安装 pip install -r example-requirements.txt关于 example-requirements.txt: # ####### example-requirements.txt ####### # ###### Requirements without Version Specifiers ###### nose nose-cov beautifulsoup4 # ###### Requirements with Version Specifiers ###### # See https://www.python.org/dev/peps/...
相关文章
文章评论
共有0条评论来说两句吧...
文章二维码
点击排行
推荐阅读
最新文章
- Docker快速安装Oracle11G,搭建oracle11g学习环境
- CentOS7,CentOS8安装Elasticsearch6.8.6
- Eclipse初始化配置,告别卡顿、闪退、编译时间过长
- SpringBoot2整合Redis,开启缓存,提高访问速度
- CentOS7设置SWAP分区,小内存服务器的救世主
- CentOS7,8上快速安装Gitea,搭建Git服务器
- CentOS7安装Docker,走上虚拟化容器引擎之路
- CentOS关闭SELinux安全模块
- Jdk安装(Linux,MacOS,Windows),包含三大操作系统的最全安装
- Docker安装Oracle12C,快速搭建Oracle学习环境