因为服务器连不了外网,所有的软件安装都需要离线安装,介绍以下几种方式:
1. 安装PyPI上的.whl文件
1.1 从 PyPI · The Python Package Index网站下载aiohttp · PyPI .whl文件
1.2 pip install安装:
pip install yarl-1.15.2-py3-none-any.whl
ps: 报错显示Retrying(Retrying(total=4,connect=None,……))是因为缺失依赖包,不是网络问题,等到运行结束,会提示缺失的依赖包,继续下载安装依赖包即可。
2. 安装PyPI上的tar.gz文件
2.1 PyPI · The Python Package Index网站下载aiohttp · PyPI源码包
2.2 解压并安装
tar zxvf aiohttp-3.8.6.tar.gz
cd aiohttp-3.8.6
python setup.py install
3.安装github上的.zip文件
3.1 从github上下载.zip的源码文件
3.2 解压后并安装
python setup.py install
4. 安装.deb文件
4.1 下载unzip的deb安装包:https://mirror.tuna.tsinghua.edu.cn/ubuntu/pool/main/u/unzip/unzip_6.0-20ubuntu1.1_amd64.deb
也可以到https://pkgs.org/网站查找相应工具
4.2 安装软件包:
dpkg -i unzip_6.0-20ubuntu1.1_amd64.deb
5. 安装tgz
5.1 下载源码安装包:The Tree Command for Linux Homepage,选择最新版:
2.2 解压缩和安装即可
tar -zxvf tree-2.1.1.tgz
cd tree-2.1.1
make install
还可参考:”conda,pip,git clone和源码安装“四种方式安装 python 包_conda git clone-优快云博客