python安装方式:pip(whl)、setup.py(tar.gz)、easy_install(egg)

本文介绍了Python的离线安装方法,包括使用pip安装whl文件,通过setup.py安装tar.gz包,以及利用easy_install安装egg文件。针对网络问题或公司网络环境限制,提供了下载包到本地再进行安装的解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

一、前言
python多种安装方式,本章讲述命令离线安装
原因:
1.国外资源缓慢,可能会超时;
2.国内资源有时下载也会有问题;
3.部分公司的网络环境限制,例如不允许使用外网(个人经历,举例:海康***等安防领域的公司对于网络的要求比较高,外网环境受限)
下载包链接(可能比较卡):https://pypi.org

二、直接安装
如果可以直接Python 编辑器如pycharm–setting–搜索安装包–点击install --安装成功,很方便
在这里插入图片描述
但安装不成功(具体安装不成功原因需根据对应的报错信息,自行查找),可以尝试下载对应的包,使用命令安装

二、命令安装

  1. pip
    pip list:列出已安装的包名
    在这里插入图片描述
    pip install +包名
    如果是远程安装可能出现超时重试、报错、无法安装成功
    在这里插入图片描述
creating /root/miniconda3/envs/open-mmlab/lib/python3.8/site-packages/mmdet3d-0.17.1-py3.8-linux-x86_64.egg Extracting mmdet3d-0.17.1-py3.8-linux-x86_64.egg to /root/miniconda3/envs/open-mmlab/lib/python3.8/site-packages Adding mmdet3d 0.17.1 to easy-install.pth file Installed /root/miniconda3/envs/open-mmlab/lib/python3.8/site-packages/mmdet3d-0.17.1-py3.8-linux-x86_64.egg Processing dependencies for mmdet3d==0.17.1 Searching for trimesh<2.35.40,>=2.35.39 Reading https://pypi.org/simple/trimesh/ Downloading https://files.pythonhosted.org/packages/01/67/1cfa89a7b8554b8514889fc93cc748acf086a2f429975f3ecdb8d7389351/trimesh-2.35.39.tar.gz#sha256=e0877d765381bf45d820ac47d7e04d108c133149a53526e34e125c2bdafdea88 Best match: trimesh 2.35.39 Processing trimesh-2.35.39.tar.gz Writing /tmp/easy_install-qvbpfm0x/trimesh-2.35.39/setup.cfg Running trimesh-2.35.39/setup.py -q bdist_egg --dist-dir /tmp/easy_install-qvbpfm0x/trimesh-2.35.39/egg-dist-tmp-d2qz6me2 /root/miniconda3/envs/open-mmlab/lib/python3.8/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated. !! ******************************************************************************** Please avoid running ``setup.py`` directly. Instead, use pypa/build, pypa/installer or other standards-based tools. See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details. ******************************************************************************** !! self.initialize_options() zip_safe flag not set; analyzing archive contents... Adding trimesh 2.35.39 to easy-install.pth file Installed /root/miniconda3/envs/open-mmlab/lib/python3.8/site-packages/trimesh-2.35.39-py3.8.egg Searching for tensorboard Reading https://pypi.org/simple/tensorboard/ Downloading https://files.pythonhosted.org/packages/5d/12/4f70e8e2ba0dbe72ea978429d8530b0333f0ed2140cc571a48802878ef99/tensorboard-2.19.0-py3-none-any.whl#sha256=5e71b98663a641a7ce8a6e70b0be8e1a4c0c45d48760b076383ac4755c35b9a0
最新发布
03-26
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值