Notes
Manage Necessary Tools
- Download & Install Anaconda navigator
- Download & Install VS Code → set as
PATH - Create an empty folder at desired location → ‘
mkdir new_folder’ in powershell. - Open with VS Code → in powershell
cd new_folder code . - Create a virtual environment using Conda (iff Anaconda is installed) →
conda -p myvenv python==3.1xmyvenv→ is the name of your virtual environment folder.python==3.1x→ the version of python you want to use for creating your venv. (bestpython==3.10)
- Activate the venv (very important) →
conda activate myvenv/- This means that virtual environment is activated and all the libraries/modules will be installed in this folder only.
- Create ‘requirements.txt’ → this file holds all the necessary libraries/modules for development to download (eg. scikit-learn, pandas, numpy, etc.)
- Install all the packages written in ‘requirements.txt’ →
pip install -r requirements.txt
Types of files
-
Jupyter Notebook file → ‘filename.ipynb’
-
Python file → ‘test.py’ (the file name can be anything)
-
To run the ‘python’ file →
python test.py -
To run ‘jupyter’ file
- Install necessary packages
- ‘ipykernel’ → responsible for providing specific kernel to jupyter notebook file
- Select the venv python kernel for execution
- Install necessary packages
Programs to try
- In python (
.py) fileprint(1+1) - In jupyter notebook (
ipynb) file1+1 # then click on run icon