当前位置:首页 » 编程语言 » pythoncommands安装

pythoncommands安装

发布时间: 2022-08-05 22:41:27

Ⅰ 如何安装python的第三方模块

通过pip来安装python模块

安装 easy_install pip

D:work>easy_installpip
Searchingforpip
Bestmatch:pip6.1.1
Processingpip-6.1.1-py2.7.egg
pip6.1.-install.pth
Installingpip-script.pyscripttoC:Python27Scripts
Installingpip.exescripttoC:Python27Scripts
Installingpip2.7-script.pyscripttoC:Python27Scripts
Installingpip2.7.exescripttoC:Python27Scripts
Installingpip2-script.pyscripttoC:Python27Scripts
Installingpip2.exescripttoC:Python27Scripts

Usingc:python27libsite-packagespip-6.1.1-py2.7.egg
Processingdependenciesforpip

运行 pip install xlrd

Usage:
pip<command>[options]

Commands:
installInstallpackages.
uninstallUninstallpackages.
.
listListinstalledpackages.
.
searchSearchPyPIforpackages.
.
zipDEPRECATED.Zipindivialpackages.
unzipDEPRECATED.Unzipindivialpackages.
helpShowhelpforcommands.

GeneralOptions:
-h,--helpShowhelp.
--,ignoring
.
-v,--verboseGivemoreoutput.Optionisadditive,andcanbe
usepto3times.
-V,--versionShowversionandexit.
-q,--quietGivelessoutput.
--log<path>Pathtoaverboseappendinglog.
--proxy<proxy>Specifyaproxyintheform
[user:passwd@]proxy.server:port.
--retries<retries>
attempt(default5times).
--timeout<sec>Setthesockettimeout(default15seconds).
--exists-action<action>:
(s)witch,(i)gnore,(w)ipe,(b)ackup.
--trusted-host<hostname>Markthishostastrusted,eventhoughitdoes
nothavevalidoranyHTTPS.
--cert<path>PathtoalternateCAbundle.
--client-cert<path>PathtoSSLclientcertificate,asinglefile

inPEMformat.
--cache-dir<dir>Storethecachedatain<dir>.
--no-cache-dirDisablethecache.
--disable-pip-version-check
Don'

download.Impliedwith--no-index.

Ⅱ python怎么安装sendmail

Python已经被移植在许多平台上(经过改动使它能够工作在不同平台上)。

您需要下载适用于您使用平台的二进制代码,然后安装Python。

如果您平台的二进制代码是不可用的,你需要使用C编译器手动编译源代码。

编译的源代码,功能上有更多的选择性, 为python安装提供了更多的灵活性。。。

Ⅲ 安装了python 2.7.10之后需要怎样安装python x y

python使用内置的pip安装package很简单,以WINDOWS下使用为例说明,使用命令pipinstall包名即可。1、在命令行下切换到python目录,一般为c:\python27,pip在python安装目录的Scripts目录下,命令如下:cdc:\python27\scripts2、切换到目录之后直接使用命令安装即可,命令如下,例如要安装flask,则使用:pipinsatllflask3、其它说明,如果卸载包则使用pipuninstall包名来卸载包,以下为pip参数说明:Usage:pip[options]Commands:installInstallpackages.downloadDownloadpackages.uninstallUninstallpackages..listListinstalledpackages..searchSearchPyPIforpackages....GeneralOptions:-h,--helpShowhelp.--,.-v,--verboseGivemoreoutput.Optionisadditive,andcanbeusepto3times.-V,--versionShowversionandexit.-q,--quietGivelessoutput.--logPathtoaverboseappendinglog.--proxySpecifyaproxyintheform[user:passwd@]proxy.server:port.--(default5times).--timeoutSetthesockettimeout(default15seconds).--exists-:(s)witch,(i)gnore,(w)ipe,(b)ackup.--trusted-hostMarkthishostastrusted,.--certPathtoalternateCAbundle.--client-,.--cache-dirStorethecachedatain.--no-cache-dirDisablethecache.--disable-pip-version-checkDon'download.Impliedwith--no-index.4、注意事项,如果在windows下安装失败提示:Unabletofindvcvarsall.bat,则说明这个包需要编译,则要在WINDOWS系统中安装visualstudio2008。5、linux下pip安装package与WINDOWS的语法相同,使用pipinstallSomePackage即可,linux下需要注意的是权限问题,应当使用root用户执行命令。

Ⅳ 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 commands 需要导入 哪个模块

要获得shell命令的输出只需要`cmd`就可以了,
需要得到命令执行的状态则需要判断$?的值, 在Python中有一个模块commands也很容易做到以上的效果.

看一下三个函数:

1). commands.getstatusoutput(cmd)

用os.popen()执行命令cmd, 然后返回两个元素的元组(status, result). cmd执行的方式是{ cmd ; } 2>&1, 这样返回结果里面就会包含标准输出和标准错误.

2). commands.getoutput(cmd)

只返回执行的结果, 忽略返回值.

3). commands.getstatus(file)

返回ls -ld file执行的结果.

看一下这些函数使用的例子:
>>> import commands
>>> commands.getstatusoutput('ls /bin/ls')
(0, '/bin/ls')
>>> commands.getstatusoutput('cat /bin/junk')
(256, 'cat: /bin/junk: No such file or directory')
>>> commands.getstatusoutput('/bin/junk')
(256, 'sh: /bin/junk: not found')
>>> commands.getoutput('ls /bin/ls')
'/bin/ls'
>>> commands.getstatus('/bin/ls')
'-rwxr-xr-x 1 root 13352 Oct 14 1994 /bin/ls'

Ⅵ 安装python模块时报错如何解决

直接使用IDE安装
或者下载模块包手动安装
pip3 install setup.py

Ⅶ python3.6有commands包吗

教你一种包有没有的办法吧

如果你安装了python后,打开“开始",→运行,输入”cmd"

然后pip install +包名称,如果能安装,则存在,否则则没有。还有一种是从三方查找

网页链接,在该网页中查看是否有你需要的,然后下载安装即可

Ⅷ 如何使用python 2.7.10 内置pip安装package

python使用内置的pip安装package很简单,以WINDOWS下使用为例说明,使用命令pip install 包名即可。
1、在命令行下切换到python目录,一般为c:\python27,pip在python安装目录的Scripts目录下,命令如下:
cd c:\python27\scripts
2、切换到目录之后直接使用命令安装即可,命令如下,例如要安装flask,则使用:
pip insatll flask
3、其它说明,如果卸载包则使用pip uninstall 包名 来卸载包,以下为pip参数说明:
Usage:
pip <command> [options]

Commands:
install Install packages.
download Download 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.
hash Compute hashes of package archives.
completion A helper command used for command completion
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.
4、注意事项,如果在windows下安装失败提示:Unable to find vcvarsall.bat,则说明这个包需要编译,则要在WINDOWS系统中安装visual studio 2008。
5、linux下pip安装package与WINDOWS的语法相同,使用pip install SomePackage
即可,linux下需要注意的是权限问题,应当使用root用户执行命令。

Ⅸ python 利用pip安装包总是失败,求教

试一下先升级pip到最新版再操作。

热点内容
tampermonkey脚本 发布:2025-01-22 18:53:17 浏览:116
windows7共享文件夹 发布:2025-01-22 18:53:17 浏览:478
如何调节安卓手机的内存 发布:2025-01-22 18:49:30 浏览:638
佳能相机存储卡怎么取消 发布:2025-01-22 18:40:59 浏览:568
天猫宝贝上传 发布:2025-01-22 18:35:09 浏览:544
ipad如何登录金铲铲安卓账号 发布:2025-01-22 18:32:09 浏览:319
加密沟通 发布:2025-01-22 18:31:22 浏览:555
win7ftp用户名和密码设置 发布:2025-01-22 17:46:48 浏览:221
三表联查的sql语句 发布:2025-01-22 17:27:13 浏览:418
安卓怎么解压分卷压缩 发布:2025-01-22 17:24:59 浏览:721