Setting up a virtual environment and Jupyter Lab on a Windows environment involves a few steps. These instructions will guide you through the process of installing Python, creating a virtual environment, and then installing Jupyter Lab within that environment.
1. Install Python
First, ensure that Python is installed on your system. If it's not installed:
1. Download the latest Python installer from the [official Python website](https://www.python.org/downloads/).
2. Run the installer. Make sure to check the box that says **Add Python to PATH** during installation.
2. Open Command Prompt
- Press `Win + R`, type `cmd`, and press Enter to open the Command Prompt.
3. Update pip (Optional)
It's a good practice to ensure that pip, setuptools, and wheel are up to date. In the Command Prompt, run:
python -m pip install --upgrade pip setuptools wheel
4. Create a Virtual Environment
Choose a directory where you want to create your project. Navigate to it using the Command Prompt, then create a virtual environment within that directory by running:
python -m venv myenv
Replace `myenv` with the name you wish to give to your virtual environment.
5. Activate the Virtual Environment
Before you can start using the virtual environment, you need to activate it. On Windows, run:
myenv\Scripts\activate
Your command prompt should now indicate that the virtual environment is active by showing its name in parentheses.
6. Install Jupyter Lab
With the virtual environment activated, install Jupyter Lab by running:
pip install jupyterlab
7. Start Jupyter Lab
Once Jupyter Lab is installed, you can start it with the following command:
jupyter lab
This command will start the Jupyter Lab server and open Jupyter Lab in your default web browser.
8. Deactivate the Virtual Environment
When you're done working in the virtual environment, you can deactivate it by running:
deactivate
This will return you to the global Python environment.
These steps should set you up with a Python virtual environment where you can work on your projects using Jupyter Lab on a Windows machine. Remember, every time you start a new Command Prompt session and want to work on your project, you'll need to navigate to your project directory and activate the virtual environment as shown in step 5.