Python如何安装第三方模块
作者:Python 发布时间:2023-08-01 12:50:07
标签:Python,第三方模块
Python中有哪几种方法安装第三方模块,安装Python第三方模块的方法有很多,这里介绍三种方法安装第三方模块。
【方法一】: 通过setuptools来安装python模块
首先下载 http://peak.telecommunity.com/dist/ez_setup.py
NOTE: 最好下载个setuptools,本人是15.2版本,里面包含了ez_setup
运行 python ez_setup.py
D:\work\installation\setuptools-15.2\setuptools-15.2>python ez_setup.py > 1.txt
Extracting in c:\users\admini~1\appdata\local\temp\tmpbxikxf
Now working in c:\users\admini~1\appdata\local\temp\tmpbxikxf\setuptools-15.2
Installing Setuptools
......
Copying setuptools-15.2-py2.7.egg to c:\python27\lib\site-packages
setuptools 15.2 is already the active version in easy-install.pth
Installing easy_install-script.py script to C:\Python27\Scripts
Installing easy_install.exe script to C:\Python27\Scripts
Installing easy_install-2.7-script.py script to C:\Python27\Scripts
Installing easy_install-2.7.exe script to C:\Python27\Scripts
Installed c:\python27\lib\site-packages\setuptools-15.2-py2.7.egg
Processing dependencies for setuptools==15.2
Finished processing dependencies for setuptools==15.2
运行 easy_install py
D:\work>easy_install py #py 为第三方库文件
Searching for py
Best match: py 1.4.26
Adding py 1.4.26 to easy-install.pth file
Using c:\python27\lib\site-packages
Processing dependencies for py
Finished processing dependencies for py
【方法二】: 通过pip来安装python模块
安装 easy_install pip
D:\work>easy_install pip
Searching for pip
Best match: pip 6.1.1
Processing pip-6.1.1-py2.7.egg
pip 6.1.1 is already the active version in easy-install.pth
Installing pip-script.py script to C:\Python27\Scripts
Installing pip.exe script to C:\Python27\Scripts
Installing pip2.7-script.py script to C:\Python27\Scripts
Installing pip2.7.exe script to C:\Python27\Scripts
Installing pip2-script.py script to C:\Python27\Scripts
Installing pip2.exe script to C:\Python27\Scripts
Using c:\python27\lib\site-packages\pip-6.1.1-py2.7.egg
Processing dependencies for pip
Finished processing dependencies for pip
运行 pip install xlrd
Usage:
pip <command></command> [options]
Commands:
install Install packages.
uninstall Uninstall packages.
freeze Output installed packages in requirements format.
list List installed packages.
show Show information about installed packages.
search Search PyPI for packages.
wheel Build wheels from your requirements.
zip DEPRECATED. Zip individual packages.
unzip DEPRECATED. Unzip individual packages.
help Show help for commands.
General Options:
-h, --help Show help.
--isolated Run pip in an isolated mode, ignoring
environment variables and user configuration.
-v, --verbose Give more output. Option is additive, and can be
used up to 3 times.
-V, --version Show version and exit.
-q, --quiet Give less output.
--log <path> Path to a verbose appending log.
--proxy <proxy> Specify a proxy in the form
[user:passwd@]proxy.server:port.
--retries <retries> Maximum number of retries each connection should
attempt (default 5 times).
--timeout <sec> Set the socket timeout (default 15 seconds).
--exists-action <action> Default action when a path already exists:
(s)witch, (i)gnore, (w)ipe, (b)ackup.
--trusted-host <hostname> Mark this host as trusted, even though it does
not have valid or any HTTPS.
--cert <path> Path to alternate CA bundle.
--client-cert <path> Path to SSL client certificate, a single file
containing the private key and the certificate
in PEM format.
--cache-dir <dir> Store the cache data in <dir>.
--no-cache-dir Disable the cache.
--disable-pip-version-check
Don't periodically check PyPI to determine
whether a new version of pip is available for
download. Implied with --no-index.
【方法三】:直接从网上下载下可执行文件来安装.
比如说,去 >>> pythonlibs <<< 网站,提供了很多Python非官方包下载,二进制文件,下载安装方便。
来源:https://www.py.cn/jishu/jichu/10441.html


猜你喜欢
- 前言今天在开发时发现一个奇怪的问题,我手动改完数据库竟然不生效,反复确认环境无误后猜测是缓存的问题,因为是新接手的项目,代码还不熟悉,仔细一
- 如下所示:import urllibimport urllib2 import osimport timeimport re import
- 区块链中的共识算法在比特币公链架构解析中,就曾提到过为了实现去中介化的设计,比特币设计了一套共识协议,并通过此协议来保证系统的稳定性和防攻击
- 自定义事件也可以用来创建自定义的表单输入组件,使用 v-model 来进行数据双向绑定。所以要让组件的 v-model 生效,它必须:接受一
- asp使用fso对象遍历目录及目录下的文件代码:<%@ Language=VBScript %><%&
- 前言:对于 图片处理,在日常生活中我们常常能够看到。比如发个朋友圈之前,我们需要给自己的照片加个滤镜;在上传头像时候,需要对照片进行裁剪,这
- Python小白一只,正在成长,程序自己设计,很多不足,算法很多地方能优化。欢迎大佬来指教。游戏效果创建设置类,储存游戏基础数据可以不使用这
- 相信每个前端工程师都有自己喜爱的javascript框架,说情感也好,道信仰也罢,javascript框架带给人的不仅仅是便捷的开发,更有一
- 1.如何用函数先定义后调用,定义阶段只检测语法,不执行代码调用阶段,开始执行代码函数都有返回值定义时无参,调用时也是无参定义时有参,调用时也
- 1、利用Python中的random模块中的choice方法random.choice()可以从任何序列,比如list列表中,选取一个随机的
- 前面的深入理解Routing章节,我们讲到了在MVC中,除了使用默认的ASP.NET 5的路由注册方式,还可以使用基于Attribute的特
- 在 Python 中,一般情况下我们可能直接用自带的 logging 模块来记录日志,包括我之前的时候也是一样。在使用时我们需要配置一些 H
- pytorch加载图片数据集有两种方法。1.ImageFolder 适合于分类数据集,并且每一个类别的图片在同一个文件夹, ImageFol
- 前言H2数据库是一个开源的关系型数据库。H2采用java语言编写,不受平台的限制,同时支持网络版和嵌入式版本,有比较好的兼容性,支持相当标准
- 前言使用 requests进行爬取、BeautifulSoup进行数据提取。主要分成两步: 第一步是解析图书列表页,并解析出里面的图书详情页
- 一、概述在ubuntu环境下进行嵌入式开发,我们在进行不同的项目开发时,可能会遇到python环境不统一的情况。这时,我们可以通过updat
- 日前,Mozilla 的 Arun Ranganathan 向 W3C 提交了一个草案,旨在推出一个 JavaScript API,让 Ja
- 1. 真值测试所谓真值测试,是指当一种类型对象出现在if或者while条件语句中时,对象值表现为True或者False。弄清楚各种情况下的真
- 如下所示:#先下载psutil库:pip install psutilimport psutilimport os,datetimedef
- 本文介绍的是python中pandas.DataFrame对行与列求和及添加新行与列的相关资料,下面话不多说,来看看详细的介绍吧。方法如下: