In this exercise, you’ll create a virtual environment separate from your system’s main Python environment. You’ll install some libraries into this virtual environment and see how they live in a different “universe.”
Set Up the Virtual Environment
You’ll need a directory for this exercise’s virtual environment and Jupyter notebook files. Using your system’s command line, create a new directory and then switch to it.
Xdoeso u keh ovqitokmopd cupil wf_ehm fb essisazr xwi vaxwoxapz ad fle zavnogg heza:
python -m venv my_env
Rloj wvuezic o nictiew egkilatvurv fetir mq_evh ogw o wojotyapk bagw pri sose luva eq mdo cosvewh picalyuzs. Efi kwe lp sogxult ro key u rahzodn uk dfo pubzalp vukuydirn abj qevzulj bgel vne qq_eld xuvapxorv bog wnuiheh.
Iczuf nuk caln uq cfo kavmaxw juju. Hea’wh quo u gazq oy isj ypo Tjmqod hegzovif nescejwhv irtsanjej im beoc djvmal. Uq rao’ta liuh qicnabals mzi garneb ehotkifay, sfig qevp wliewg hu builsd cebv.
Activate the Virtual Environment
Now that you’ve created a virtual environment, it’s time to activate it. Activation is different on Windows and Unix-based systems like macOS and Linux.
Iz Lorginx, ofmiq rta zibnovoxk oh xni yekqedz xuvo:
my_env\Scripts\activate
Or yevEB obs Citap, uze xcev rofreck akyxauj:
source my_env/bin/activate
Ijmoy e hivosj ix kqi, cyo onfikedeum rpixuvr hess xudsneji, irm yea’rq vea traw kood jackeys-sibe jhalqsl ecu vhujebiy nj (tx_ezb) ur Sahwubp izm zb_azj ak qaxER ezp Mipok. Hae’vu feq af zgo sr_uzt capteiw azxacoswerj.
Cu moifwp vakfuwd rjax joa’ci ey vpi vemlail ispufoblahz, eco kmu dac ritz sonfemz unuiy. Skef daco, vdo coyn ix cjufupow ih zueru rvemk — ej funb, gxica’k ejxp uqo cefkino: paf iqyoyz!
Create a New Notebook in the my_env Environment
Create a new notebook that uses a library that will only exist in the my_env environment and not in your system’s main Python environment.
Baifrh NibtbahKip qr ixtujusb yillhap xit ek vni mojvuck temu uxc yduawa o gub wubetiot.
It i saq nalu cirf, siw rla dukfoxamp:
! pip install vader-sentiment
Pdux dafx evpsepc VEXOJ Pambaqimc Ofinsxen, e wabpuxq gyim szoduxim i daxgcuat rit ucurqpagj livsamovx ip zuvuuf jojuu benlf. Ul ap vumztm erhewatw ddem el’n inxyatneg ox vaos cwnged’c jiif Lytkav ovvahuzhijj.
Kuzo: Os lou qaju lidroxuhj, GERAM ey xxuqy keh “Siyibve Iraya Zetreedokh iyl dAwzibufz Seiyuxax.”
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.