當前位置:首頁 » 編程語言 » 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到最新版再操作。

熱點內容
無需伺服器搭建網站 發布:2025-01-22 21:53:34 瀏覽:114
旅遊青蛙安卓版如何下載 發布:2025-01-22 21:52:51 瀏覽:317
歐文5的配置是什麼 發布:2025-01-22 21:30:23 瀏覽:108
日誌存儲資料庫 發布:2025-01-22 21:30:07 瀏覽:474
gulp上傳cdn 發布:2025-01-22 21:27:34 瀏覽:203
emule文件夾 發布:2025-01-22 21:23:23 瀏覽:981
s7e什麼時候推送安卓7 發布:2025-01-22 21:20:59 瀏覽:203
狐狸的清白腳本分析 發布:2025-01-22 21:19:59 瀏覽:182
如何破解仿射密碼 發布:2025-01-22 21:13:53 瀏覽:81
百度視頻存儲 發布:2025-01-22 21:13:11 瀏覽:168