npm 修改源 pip 修改源
npm修改源
由于不可说原因,npm install时,速度总是不尽如人意,解决办法是修改npm的数据源
npm config set registry https://registry.npm.taobao.org
1
修改后可以通过这个进行测试
npm config get registry
pip-修改为国内镜像源
pip 常用命令
pip install ./downloads/SomePackage-1.0.4.tar.gz pip install http://my.package.repo/SomePackage-1.0.4.zippip search "query"##查询package的具体名称pip uninstall package-name ##卸载pip install SomePackage==1.0.4 ##指定版本的安装pip install --upgrade SomePackage ##package 版本升级
pip-修改国内镜像源
mkdir ~/.pip vim ~/.pip/pip.conf[global]index-url = http://mirrors.aliyun.com/pypi/simple/[install]trusted-host = mirrors.aliyun.com
注意事项:
http://mirrors.aliyun.com/pypi/simple/
中的simple目录必须有。--no-cache-dir
重新下载安装包,而不是使用缓存包。trusted-host = mirrors.aliyun.com
一定要加上这行,否则会报错。-
pip国内镜像源。
阿里云 http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣 http://pypi.douban.com/simple
Python官方 https://pypi.python.org/simple/
v2ex http://pypi.v2ex.com/simple/
中国科学院 http://pypi.mirrors.opencas.cn/simple/
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
报错汇总
报错内容
pip install mysql-pythonCollecting mysql-python The repository located at pypi.douban.com is not a trusted or secure host and is being ignored. If this repository is available via HTTPS it is recommended to use HTTPS instead, otherwise you may silence this waing and allow it anyways with '--trusted-host pypi.douban.com'. Could not find a version that satisfies the requirement mysql-python (from versions: )No matching distribution found for mysql-python
解决办法
编辑 vim .pip/pip.conf
[install]trusted-host = mirrors.aliyun.com
作者:wzqwer
来源链接:https://www.cnblogs.com/wzbk/p/10308190.html
版权声明:
1、JavaClub(https://www.javaclub.cn)以学习交流为目的,由作者投稿、网友推荐和小编整理收藏优秀的IT技术及相关内容,包括但不限于文字、图片、音频、视频、软件、程序等,其均来自互联网,本站不享有版权,版权归原作者所有。
2、本站提供的内容仅用于个人学习、研究或欣赏,以及其他非商业性或非盈利性用途,但同时应遵守著作权法及其他相关法律的规定,不得侵犯相关权利人及本网站的合法权利。
3、本网站内容原作者如不愿意在本网站刊登内容,请及时通知本站(javaclubcn@163.com),我们将第一时间核实后及时予以删除。