0% found this document useful (0 votes)
0 views

Topic 1 -- Python for Gen AI

Gen AI syllabus

Uploaded by

mogalpratik983
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

Topic 1 -- Python for Gen AI

Gen AI syllabus

Uploaded by

mogalpratik983
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

topic 1 -- > Python for Gen AI

1. Always create environment for new project in VS Code


2. It's important because in our python project or data science project we make
sure that we use multiple packages, multiple libraries and every couple of months
this packages or this libraries have new features and most of them are open source
packages or libraries so they definitely have a lot of features that gets included
every couple of months
3. So it's necessary that we always maintain, or try to create entire projects in a
separate environment so that there should be not any conflict as you go ahead in
project
4. Whenever a new feature is probably coming up we know with respect to the
packages, we can actually create a new project and create a new environment out
there.

Create new environment using command prompt -- >

== conda create -p venv python==3.12

1. venv is specifically our environment name and which python version we are
specifically using.
2. whenever we create environment some packages or libraries will be automatically
downloaded by this conda command
3. So whatever basic environment that is required for any python project that will
be covered up inside this particular folder.

So we need to activate this environment so to activate this environment we use


command-- >
== > conda activate venv/

after this we can run any .py files


4. to run jupyter code in VS code we need ipykernal package so we need to install
it using
==> pip install ipykernel

so whenever we need to install packages we use pip install command


ipykernel package is nothing but it provides a kernel to this specific jupyter
notebook which will be responsible in executing the python code.

Different ways to creating an environment


-----------------------------------------
It's always good idea to create separate environment for every project because we
have different set of dependencies and libraries that we need to install over
there.

1. 3 Different ways to create python environment :

== > 1. Using Python Command -- > python -m venv myenv


Inside this version activate -- > myenv\Scripts\activate
Install any kind of libraries which I want
1. pip install numpy
2. pip install pandas

to upgrade python package download recent python

== > 2. Using Linux command -- > pip install virtualenv


1. virtualenv -p python3 virtual_env
2. virtualenv\Scripts\activate or copy the relative path and paste it
3. deactivate

== > 3. Using Conda -- Install Anaconda first -- > add path into system variables
1. Run conda command to check if it's install or not properly
2. %path% run this command
3. create virtual environment -- > conda create -p venv python==3.12 -y

You might also like