① python怎样安装第三方库
方法1:下载源码,手动运行setup.py install去安装
下载对应的源码,往往都是.tar.gz,.zip的压缩包,解压后,打开windows的cmd,切换到对应目录,运行:
setup.py install
即可去安装。
方法2:利用第三方安装工具(如pip,easy_install,distribute等)去自动化安装
利用的目前常见的一些自动化安装工具,比如pip,easy_install,distribute等,自动帮你下载源码,并安装。
而且很多时候,由于要安装的包,还要依赖一些其他的别的包,而这类自动化安装工具,会自动帮你解决依赖关系,自动帮你下载并安装所缺少的那些包,所以相对来说,就省去了你的麻烦了。
② python第三方库安装到哪里
1、首先通过pip安装的第三方库,一般都在python安装路径下的Libsite-packages目录,这里可以通过pip安装一个第三方库看一下,如下图所示。
③ python怎么安装第三方类库
使用pip
大多数库都可以通过pip安装,安装方法为,在命令行窗口输入
pip install libname
libname为库名
某些库通过pip安装不了,可能是因为没有打包上传到pypi中,可以下载安装包之后离线安装,方法是
pip install libpath
libpath为本地安装包地址,这些安装包一般以whl为后缀名。表示python扩展包的windows环境下的二进制文件。
有一个专门下载这种文件的地方http://www.lfd.uci.e/~gohlke/pythonlibs/,是由加利福尼亚大学的师生为方便python用户使用而建立的,并非官方出品,使用时需自行承担风险。
源文件安装
如果下载下来的安装包为带有源文件的压缩包,解压之后,运行setup.py进行安装,方法是
命令行切换到安装包中setup.py文件所在的目录,执行 python setup.py install
运行安装包
有些类库提供了双击运行直接安装的安装包,比如python连接mysql数据库的驱动 mysql-connector-python
这些安装包的后缀名为msi或者exe。下载下来之后,双击运行之后就安装好了,前提是要根据python的版本及windows的位数下载对应的安装包,否则安装过程会报错或者直接提示无法安装。
④ 如何在python虚拟环境下安装第三方包
直接使用pip安装即可,例如你是用virtualenv创建了一个名为test_venv的虚拟环境,
第一步激活虚拟环境:
source test_venv/bin/active
第二步下载模块:
pip install 模块名
⑤ python如何导入第三方依赖包API
第一种基本安装方法
1 下载第三方包,解压
2 在命令提示符里输入cmd,然后用cd进入到第三方包的路径下
3 输入python setup.py build
4 输入python setup.py install
看到包内的文件在安装即可……
第二种 用pip安装
pip可以很方便的安装、卸载和管理Python的包。
pip install xxxx
第三种 直接安装anaconda3,大部分常用依赖包都已经有了。
⑥ 如何安装第三方python 包
第一种pip方式,现在python都带pip,直接pip install 包名就行了
第二种基本安装方法
1 下载第三方包,解压
2 在命令提示符里输入cmd,然后用cd进入到第三方包的路径下
3 输入Python setup.py build
4 输入python setup.py install
看到包内的文件在安装即可
⑦ 如何在python中安装第三方库
如安装 requests 库
pip install requests
⑧ python 第三方库怎么安装
【方法一】: 通过setuptools来安装python模块
首先下载
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> [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 indivial packages.
unzip DEPRECATED. Unzip indivial 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非官方包下载,二进制文件,下载安装方便.
⑨ 如何安装python及第三方包
以win环境下使用anaconda安装numpy模块包为例: 开始-运行-cmd 在dos命令行中输入conda install numpy 敲回车,然后anaconda就开始自动下载并安装了!
⑩ python安装第三方的库package的方法,有谁懂,求指导
python安装第三方模块有多种方法:
直接下载安装包安装,解压后,进入目录,直接pythonsetup.pyinstall
使用包管理器pip安装,直接pipinstall包名
如果解决了您的问题请采纳!
如果未解决请继续追问!