Notes

Manage Necessary Tools

  1. Download & Install Anaconda navigator
  2. Download & Install VS Code set as PATH
  3. Create an empty folder at desired location mkdir new_folder’ in powershell.
  4. Open with VS Code in powershell
    cd new_folder
    code .
  5. Create a virtual environment using Conda (iff Anaconda is installed) conda -p myvenv python==3.1x
    • myvenv is the name of your virtual environment folder.
    • python==3.1x the version of python you want to use for creating your venv. (best python==3.10)
  6. 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.
  7. Create ‘requirements.txt’ this file holds all the necessary libraries/modules for development to download (eg. scikit-learn, pandas, numpy, etc.)
  8. 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

    1. Install necessary packages
      • ‘ipykernel’ responsible for providing specific kernel to jupyter notebook file
    2. Select the venv python kernel for execution

Programs to try

  • In python (.py) file
    print(1+1)
  • In jupyter notebook (ipynb) file
    1+1
    # then click on run icon

References