Yuav Paub
- Install: Qhib installer > xaiv Add Python 3.7 rau PATH > Install Now > tos kom paub meej.
- Tom ntej, qhib Command Prompt > nkag mus print ("Hello World!").
- Inspect PIP commands los ntawm kev nkag mus C:\Users\acpke> pip --help.
Kab lus no piav qhia yuav ua li cas rau nruab Pob Installer rau Python (PIP) ntawm Windows Vista qhov system thiab tshiab dua. Yog tias koj muaj lub tshuab qub, koj yuav tsum tau txais qhov qub me ntsis ntawm Python, xws li v3.4.
Yuav ua li cas rau nruab PIP ntawm Windows 10
PIP suav nrog tawm-ntawm-tus-lub thawv hauv cov ntawv tshiab ntawm Python, thiab koj yuav xav tau Python rau PIP kom siv tau.
-
Nkag mus rau nplooj ntawv rub tawm ntawm lub vev xaib ntawm https://www.python.org txhawm rau rub lub installer rau cov lus Python.
-
nplooj ntawv tseem ceeb yuav tsum muab lub pob yooj yim, tab sis nyob rau hauv qhov xwm txheej, koj tsaws ntawm nplooj ntawv nrog cov npe ntawm cov ntaub ntawv, xyuas kom koj rub tawm Windows x86-64 executable installerlossis Windows x86 executable installer, nyob ntawm seb koj puas muaj lub tshuab 32- lossis 64-ntsis.
- Ib zaug rub tawm, nyem ob npaug rau cov ntaub ntawv installer.
- Ntawm thawj qhov screen, xaiv qhov Add Python 3.7 rau PATH kev xaiv.
-
Xaiv Install Now rau saum. Koj tuaj yeem pom qhov no yuav nruab ob peb yam ntxiv: IDLE, Python Integrated Development Environment; Cov ntaub ntawv siv Python, thiab PIP nws tus kheej.
-
Tam sim no tus installer yuav ua nws yam thiab khiav los ntawm cov txheej txheem teeb.
-
Koj yuav pom qhov kev tshuaj ntsuam xyuas thaum kawg qhia rau koj paub tias kev teeb tsa tau ua tiav. Koj tseem tuaj yeem xaiv Disable path length limit los hloov qhov kev teeb tsa hauv Windows uas tsis tso cai nkag mus rau cov ntaub ntawv ntev dua 260 cim.
Siv Python ntawm Windows 10 Tshuab
Python yog ib hom lus programming, yog li siv nws koj yuav tsum kawm paub yuav ua li cas hauv nws. Qhov ntawd dhau ntawm cov kab lus no, tab sis cia peb tshawb xyuas seb Python puas tau teeb tsa zoo.
-
Qhib Command Prompt thiab ntaus cov hauv qab no:
C:\Users\acpke> python --version
Python 3.7.4
-
Koj yuav tsum pom Python tso nws tus lej version. Koj tuaj yeem tshawb xyuas seb nws puas ua haujlwm raug los ntawm kev muab cov lej hauv qab no rau hauv cov ntawv khoob thiab muab nws lub npe "nyob zoo-world.py" (ceeb toom cov kab khoob ntawm qhov kawg):
print ("Hello World!")
-
Tam sim no khiav nws:
C:\Users\acpke> python \path\to\hello-world.py
Hello World!
Siv PIP los nruab Python Pob ntawm Windows 10 Tshuab
Tam sim no peb paub Python ua haujlwm, cia peb kuaj PIP.
-
Txawm tias PIP yuav tsum tau teeb tsa, peb tuaj yeem kuaj xyuas nws los ntawm kev tawm cov hauv qab no ntawm cov lus txib:
C:\Users\acpke> pip --help
-
Qhov no yuav tsum qhia koj cov ntsiab lus Pab rau PIP, suav nrog cov lus txib muaj. Qhov yooj yim tshaj plaws yog kev tshawb nrhiav pip, uas yuav tshawb nrhiav Python Package Index (PyPI) rau koj lub sijhawm tshawb nrhiav. Piv txwv li, xav tias peb xav tsim peb tus kheej lub web browser, cov lus txib hauv qab no yuav qhia cov npe ntawm tag nrho cov pob hauv PyPI nrog lo lus tseem ceeb "browser":
C:\Users\acpke> pip search browser
-
Raws li koj tuaj yeem pom hauv cov txiaj ntsig hauv cov duab hauv qab no, muaj ib pob hu ua FireSnake-Browser, uas yog qhov web browser tivthaiv twb tau sau npe hauv Python. Yog li, tsis yog yuav tsum tau sau cov khoom xws li tso saib nplooj ntawv, tabs, thiab bookmarks, peb tsuas yog rub tawm qhov no thiab kho nws raws li peb xav tau.
Koj tuaj yeem nruab ib pob nrog cov lus txib hauv qab no:
C:\Users\acpke> pip nruab FireSnake-Browser
-
Hmoov tsis zoo, hloov kho tag nrho cov pob teeb tsa tsis yooj yim li hloov kho Linux faib; koj yuav tsum ua li ntawd rau txhua pob. Thaum koj pom tias nws tsis muaj hnub dhau los khiav cov lus txib no los ua qhov hloov tshiab:
C:\Users\acpke> pip nruab FireSnake-Browser --upgrade
-
Thaum kawg, tshem ib pob yog ib qho yooj yim li khiav cov lus txib no:
C:\Users\acpke> pip uninstall FireSnake-Browser