auto installation of python, libraries & jupyter notebook while creating a virtual environment in WINDOWS
- This powershell script jupyter-auto-install.ps1 will fetch the python version as per the users choice and install it.
- This scirpt will then create a virtual environment
- This script will install the python libraries (numpy, pandas & matplotlib)
- Finally install jupyter notebook and launch it in local browser
The jupyter-auto-install.ps1 scriot does the following in sequential order
- Prompt user to input Python version
- Construct the URL for the Python installer
- Define the path where you want to save the installer
- Download the Python installer from www.python.org/ftp
- Define the installation directory for Python
c:\users\$env:username\AppData\Local\Programs\Python\Python312
- Install Python in silent mode
- Define the Python directory
- Define the path for the new directory
- Check if directory was created successfully
- Change directory to the Python Scripts directory
- Upgrade pip
- Install virtual environment
- Create a virtual environment (MLlabs)
under
.$pythonDirectory\virtualenv.exe MLlabs
c:\users\$env:username\MLProjects\MLlabs
- Change directory to project location
- Activate the virtual environment
- Install numphy library [meant for numerical computing, providing powerful array operations and mathematical functions.]
- Install pandas library [meant for data manipulation and analysis, offering data structures and tools for working with structured data.]
- Install matplotlib library [meant for creating static, animated, and interactive visualizations in Python]
- Install jupyter package
- Launch Jupyter notebook on local browser
Note
Due to administartive access restrictions in windows, during the silent python installation step (i.e step 6), please click on yes when administarative prompt is displayed
Important
Due to windows security issue, the step to add python to PATH environment variables in windows in not allowed. In this case please manually add python path to the existing windows environment variables.