python小课——零基础入门——学习笔记python工具

pip快速安装模块及pycharm快捷键

2020-07-26  本文已影响0人  estate47

一、在线pip安装模块

在使用pip安装模块时会因为网络问题超时安装失败,现推荐阿里云和华清源来安装相应模块。
1.写入hosts (hosts地址: C:\Windows\Systen32\drivers\etc)

183.2.199.239 mirrors.aliyun.com
101.6.8.193 pypi.tuna.tsinghua.edu.cn

2.安装方式二选一

pip install 包 -i https://pypi.tuna.tsinghua.edu.cn/simple/ #清华源
pip install 包 -i https://mirrors.aliyun.com/pypi/simple/  #阿里源

二、离线安装模块

在工作中有时需要再内网安装相应模块,但内网中却没有网就需要打包模块来离线安装了
1.查询安装模块

pip3 freeze >requirements.txt 

2.导出安装包

pip download -d DIR -r LIST

其中,DIR为离线库导出路径,LIST为离线库列表路径,即requirements.txt 所在的路径
3.离线库快速安装

pip install --no-index --find-links=DIR -r PATH

其中DIR为离线库文件夹路径,PATH为离线库列表文件路径

三、pycharm快捷键

win
mac
上一篇 下一篇

猜你喜欢

热点阅读