Installation Guide
This guide will walk you through the essential steps to get your development environment ready for AI and Machine Learning projects on Windows.
Installing on Windows
We recommend using the Windows Subsystem for Linux (WSL) for a more seamless experience, but native Windows installations are also supported for many tools.
Option 1: Using WSL (Recommended)
WSL provides a Linux environment within Windows, offering better compatibility with many ML tools and libraries.
- Install WSL: Open PowerShell as Administrator and run:
This will install WSL and a default Linux distribution (usually Ubuntu). Follow the on-screen prompts to set up your Linux username and password.wsl --install
- Update Linux Distribution: Once WSL is installed, open your Linux distribution (e.g., Ubuntu) and run:
sudo apt update && sudo apt upgrade -y
- Install Python: Most Linux distributions come with Python pre-installed. You can check your version with:
If you need a specific version or a clean install, consider using a version manager likepython3 --version
pyenv
. - Install Pip and Virtualenv:
sudo apt install python3-pip python3-venv -y
- Create a Virtual Environment: It's best practice to use virtual environments for your projects.
Your terminal prompt should now showpython3 -m venv myenv source myenv/bin/activate
(myenv)
. - Install Core ML Libraries:
(Note: For specific GPU acceleration with TensorFlow or PyTorch, refer to their official installation guides for CUDA and cuDNN.)pip install numpy pandas scikit-learn tensorflow pytorch
Option 2: Native Windows Installation
Some tools can be installed directly on Windows. This is often simpler for beginners but might have compatibility issues with advanced libraries.
- Install Python: Download the latest Python installer from python.org. Ensure you check "Add Python to PATH" during installation.
- Install Pip: Pip is usually included with Python installations.
- Create a Virtual Environment:
Your command prompt should now showpython -m venv venv .\venv\Scripts\activate
(venv)
. - Install Core ML Libraries:
(For GPU support on native Windows, installing TensorFlow and PyTorch can be more complex due to driver and library dependencies.)pip install numpy pandas scikit-learn tensorflow pytorch
Installing on Linux (WSL)
This section assumes you have WSL 2 installed and a Linux distribution like Ubuntu ready.
- Update Package Lists:
sudo apt update && sudo apt upgrade -y
- Install Python 3 and Pip:
sudo apt install python3 python3-pip python3-venv -y
- Verify Installation:
python3 --version pip3 --version
- Create and Activate Virtual Environment:
python3 -m venv ~/ml_project_env source ~/ml_project_env/bin/activate
- Install Essential Libraries:
pip install numpy pandas matplotlib scikit-learn jupyterlab
- Install Deep Learning Frameworks:
- TensorFlow:
For GPU support, consult the official TensorFlow GPU installation guide.pip install tensorflow
- PyTorch: Visit the official PyTorch website and select your configuration (OS, package manager, CUDA version) to get the correct installation command.
Example (CPU only):
pip install torch torchvision torchaudio
- TensorFlow:
Installing on macOS
macOS provides a robust environment for AI and Machine Learning development.
- Install Homebrew (if not already installed): Homebrew is a package manager for macOS.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Install Python:
This will install the latest Python 3.brew install python
- Verify Python Installation:
python3 --version
- Install Virtualenv:
pip3 install virtualenv
- Create and Activate Virtual Environment:
Your terminal prompt should now showvirtualenv ~/ml_env source ~/ml_env/bin/activate
(ml_env)
. - Install Core ML Libraries:
pip install numpy pandas matplotlib scikit-learn jupyterlab
- Install Deep Learning Frameworks:
- TensorFlow: For macOS, especially with Apple Silicon (M1/M2 chips), TensorFlow has optimizations.
Refer to the Apple Metal plugin documentation for M-series chip acceleration.pip install tensorflow-macos
- PyTorch:
Check the PyTorch website for the most up-to-date commands.pip install torch torchvision torchaudio
- TensorFlow: For macOS, especially with Apple Silicon (M1/M2 chips), TensorFlow has optimizations.
Verifying Your Installation
Once your environment is set up and libraries are installed, you can verify them by running a simple Python script. Create a file named verify_ml.py
with the following content:
import sys
import numpy
import pandas
import sklearn
import tensorflow
import torch
print(f"Python version: {sys.version}")
print(f"NumPy version: {numpy.__version__}")
print(f"Pandas version: {pandas.__version__}")
print(f"Scikit-learn version: {sklearn.__version__}")
print(f"TensorFlow version: {tensorflow.__version__}")
print(f"PyTorch version: {torch.__version__}")
print("\nML libraries installed successfully!")
Activate your virtual environment (if you created one) and run the script:
# Example if using venv on Windows
.\venv\Scripts\activate
python verify_ml.py
# Example if using venv on Linux/macOS
source ~/ml_project_env/bin/activate
python verify_ml.py
If the script runs without errors and prints the versions of the installed libraries, your setup is complete!
1. Install Essential Tools
Set up your base environment with Python, Pip, and a virtual environment manager.
2. Install Core Libraries
Add fundamental data science and ML libraries like NumPy, Pandas, and Scikit-learn.
3. Install Deep Learning Frameworks
Install TensorFlow and/or PyTorch based on your project needs.
4. Configure GPU Support (Optional)
For performance, set up CUDA and cuDNN if you have a compatible NVIDIA GPU.