Indlela yokusebenzisa ikhadi elihlanganisiwe levidiyo

I-PIP - insiza "Lawula umugqa"yakhelwe ukusebenza ngezingxenye ze-PyPI. Uma lolu hlelo lufakwe kwikhomputha, lokhu kwenza kube lula ukufaka izintatheli ezahlukene zomphakathi wesithathu ngenkulumo yohlelo lwePython. Isigaba esicatshangwa njalo sibuyekeziwe, ikhodi yayo ithuthukisiwe futhi izinyathelo zenziwa. Okulandelayo, sizobuka inqubo yokuvuselela Umbuso usebenzisa izindlela ezimbili.

Buyekeza i-PIP yePython

Uhlelo lokuphathwa kwephakheji luzosebenza ngokufanele kuphela uma inguqulo yayo esitebeleni isetshenziswa. Ngezinye izikhathi, izingxenye zesofthiwe zishintsha ukubukeka kwazo, ngenxa yalokho okudingeka zibuyekezwe kanye ne-PIP. Ake sibheke izindlela ezimbili ezahlukene zokufaka ukwakha okusha okuzofaneleka kakhulu ezimweni ezithile.

Indlela 1: Landa inguqulo entsha ye-Python

I-PIP efakwe kwi-PC enePython elandwe kusuka kusayithi elisemthethweni. Ngakho-ke, okukhethwa kukho okulula kakhulu ukulanda i-Python yakamuva yokwakhiwa. Ngaphambi kwalokhu, akudingekile ukususa omdala, ungafaka eyodwa phezulu noma ugcine amafayela endaweni ehlukile. Okokuqala, sincoma ukuqinisekisa ukuthi ukufakwa kwenguqulo entsha kuyadingeka. Ukwenza lokhu, yenza lokhu okulandelayo:

  1. Vula iwindi Qalisa ngokucindezela inhlanganisela eyinhloko Win + Rbhalacmdbese uchofoza Ngena.
  2. Esikrinini esibonisiwe "Lawula umugqa" udinga ukungena okuboniswa ngezansi bese uchofoza Ngena:

    I-python --version

  3. Uzobona okwakhiwa kwamanje kwe-Python. Uma ingaphansi kunamanje (ngesikhathi sokubhala lokhu yi-3.7.0), khona-ke ingabuyekezwa.

Inqubo yokulanda nokuqeda inguqulo entsha kanje:

Yiya kuwebhusayithi ye-Python esemthethweni

  1. Yiya kuwebhusayithi esemthethweni ye-Python kusixhumanisi ngenhla noma ngokusebenzisa usesho kunoma yisiphi isiphequluli esikahle.
  2. Khetha isigaba "Ukulanda".
  3. Chofoza inkinobho efanelekile ukuya kuhlu lamafayela atholakalayo.
  4. Kulolu hlu, cacisa inhlangano nokubuyekeza okufunayo kukhompyutha yakho.
  5. Isifaki sisakazwa kumlando wokugcina, ngesimo sokufaka ungaxhunyiwe ku-intanethi noma ku-intanethi. Uhlu, thola olufanele bese uchofoza igama layo.
  6. Linda kuze kulandwe ukulanda bese uqhuba ifayela.
  7. Qiniseka ukuphawula ibhokisi "Engeza i-Python 3.7 bese uhamba". Ngenxa yalokhu, lolu hlelo luzofakwa ngokuzenzekelayo ohlwini lwezinto eziguqukayo.
  8. Setha uhlobo lokufakwa "Yenze ngokwezifiso ukufakwa".
  9. Manje uzobona uhlu lwazo zonke izingxenye ezitholakalayo. Qinisekisa ukuthi into iyini "ipayipi" kusebenziwe, bese uchofoza "Okulandelayo".
  10. Hlola imingcele eyengeziwe edingekayo bese ukhetha indawo yezingxenye zesofthiwe.

    Sikukwazisa ukuba ufake i-Python kwifolda yezimpande zesigaba sokuhlukanisa kwi-disk eyinkimbinkimbi.

  11. Lindela ukufakwa ukuqedela. Phakathi nale nqubo, ungavaleli iwindi lefaki futhi ungaqali kabusha i-PC.
  12. Uzokwaziswa ukuthi inqubo igcwaliswe ngempumelelo.

Manje umyalo we-PIP ovela ohlelweni lokuphatha iphakheji enegama elifanayo uzosebenza ngokufanele nawo wonke amamojula namashabhulali. Ngemuva kokuba ukufakwa kuqedile, ungaya ku-Umbuso bese uxhumana nayo.

Indlela 2: Ukuvuselelwa kwe-Manual PIP

Ngezinye izikhathi indlela yokubuyekeza yonke i-Python ukuthola inguqulo entsha ye-PIP ayifanelekile ngenxa yokungabi nalutho kwalenqubo. Kulesi simo, sincoma ukulanda ukuphathwa kwephakheji ngesandla, bese uyijova ohlelweni futhi uhamba uye emsebenzini. Udinga ukwenza nje ukuphathwa okumbalwa:

Yiya ekhasini lokulanda le-PIP

  1. Yiya ekhasini lokulanda le-PIP elisemthethweni kusixhumanisi ngenhla.
  2. Nquma ukuthi yikuphi okushiwo yizintathu ezihlongozwayo.
  3. Hambisa ikhodi yomthombo ngokuchofoza kumagama-ncazo "thola-pip.py".
  4. Uzobona yonke ikhodi yomthombo yesistimu yokuphatha iphakheji. Chofoza ngakwesokudla noma kuphi bese ukhetha "Londoloza njengo ...".
  5. Cacisa indawo elula kukhompyutha bese ulondoloza idatha lapho. Igama negama layo kufanele lishiywe lingashintshi.
  6. Dlulisa amehlo kufayela kule PC, chofoza ngakwesokudla kuso bese ukhetha "Izakhiwo".
  7. Ngenkinobho yegundane lesokunxele egcinwe phansi, khetha umugqa "Indawo" bese uyikopisha ngokuchofoza Ctrl + C.
  8. Vula iwindi Qalisa okushisayo okhiye Win + Rfaka laphocmdbese uchofoza "Kulungile".
  9. Ewindini evula, faka umyalocdbese unamathisela indlela ekopishwe ngaphambilini besebenzisa inhlanganisela Ctrl + V. Chofoza Ngena.
  10. Uzodluliselwa kwisiqondisi esikhethiwe lapho ifayela elidingekayo ligcinwa khona. Manje kufanele ifakwe ku-Python. Ukuze wenze lokhu, faka futhi usebenze umyalo olandelayo:

    I-python thola-pip.py

  11. Ukulanda nokufakwa kuzoqala. Phakathi nale nqubo, ungavali iwindi noma uthayiphe noma yini kuyo.
  12. Uzokwaziswa ngokuqedwa kokufakwa, lokhu kuboniswa nendawo yokufaka yokuboniswa.

Lokhu kuqedela inqubo yokuvuselela. Ungasebenzisa ngokuphephile i-Umbuso, landa amamojula engeziwe namashabhulali. Kodwa-ke, uma amaphutha kwenzeka uma ufaka imiyalo, sincoma ukwenza lezi zenzo ezilandelayo, bese ubuyela emuva "Landela umugqa" bese uqala ukufakwa kwe-PIP.

  1. Iqiniso liwukuthi akusiyo njalo lapho kukhishwa i-Python yemibuthano ehlukene ukuthi uhlelo oluguquguqukayo luyongezwa. Lokhu kuvame ukungabi nabalandeli. Ukuze udale ngesandla le datha, okokuqala iya kwimenyu. "Qala"lapho i-rmm cindezela khona "Ikhompyutha" bese ukhetha into "Izakhiwo".
  2. Ngakwesobunxele kuyoba nezigaba eziningana. Iya ku "Izilungiselelo zesistimu ezithuthukile".
  3. Kuthebhu "Okuthuthukisiwe" chofoza "Izinguquko zendawo ...".
  4. Dala ukuhluka kwesistimu.
  5. Mnike igamaI-Pythonpath, ngenani faka umugqa olandelayo bese uchofoza "Kulungile".

    C: Python№ Lib; C: Python№ DLLs; C: Python lib lib-tk; C: enye-i-foolder-on-the-path

    Kuphi C: - i-hard disk partition lapho iFolthon№ ifolda itholakala khona.

  6. Python№ - Uhlelo lwemibhalo (Igama lishintsha kuye ngokuthi inguqulo efakiwe).

Manje ungavala wonke amawindi, qalisa kabusha ikhompyutha yakho futhi uqhubeke nokugijima ngendlela yesibili yokubuyekeza uhlelo lokuphatha iphakethe le-PIP.

Indlela ehlukile yokwengeza imilabhu

Akuwona wonke umsebenzisi ongabuyekeza i-PIP futhi asebenzise isevisi yayo eyakhelwe ngaphakathi ukwengeza amamojula ku-Python. Ngaphezu kwalokho, akuzona zonke izinguqulo zohlelo lokusebenza olufanele ngaloluhlelo. Ngakho-ke, siphakamisa ukusebenzisa indlela ehlukile engadingi ukufakwa kwangaphambili kwezingxenye ezengeziwe. Udinga ukwenza lokhu okulandelayo:

  1. Yiya kusayithi lokulanda le-module bese ulanda njenge-archive.
  2. Vula isiqondisi kunoma iyiphi i-archiver elula bese uvula okuqukethwe kukho ifolda engenalutho ku-PC yakho.
  3. Zulazula kumafayela angaxhunyiwe bese uthola lapho. Setup.py. Chofoza kuso nge inkinobho yesinxele yegundane bese ukhetha "Izakhiwo".
  4. Kopisha noma ngekhanda indawo yayo.
  5. Qalisa "Landela umugqa" futhi ngomsebenzicdiya kumkhombandlela okopishiwe.
  6. Thayipha umyalo olandelayo bese uwusebenze:

    I-Python setup.py faka

Kuhlala kuphela ukulinda ukuqedwa kokufakwa, emva kwalokho ungaqhubeka nokusebenza namamojula.

Njengoba ubona, inqubo yokuvuselela i-PIP inzima kakhulu, kodwa konke kuzovela uma ulandela imiyalo engenhla. Uma isevisi ye-PIP ingasebenzi noma ingabuyekezwa, siye sahlongoza indlela ehlukile yokufaka amareyibrari, okuyinto ezimweni eziningi ezisebenza kahle.