This guide will help you set up Cursor (an AI-powered code editor) and UV (a fast Python package installer) for your development environment.
- Prerequisites 🛠️
- Installing Cursor 🧠
- Installing UV ⚡
- Why Use UV Instead of pip 🔍
- UV Commands Reference 📝
- Troubleshooting 🔧
Before you begin, make sure you have the following installed:
- Python (v3.8 or higher)
Cursor is an AI-powered code editor that enhances your coding experience with intelligent features.
- Visit cursor.sh and download the installer for your OS
- Run the installer and follow the prompts
- Launch Cursor and open your project folder
- Enjoy the power of AI-assisted coding! ✨
- AI Code Completion: Get intelligent code suggestions as you type
- Natural Language Commands: Ask for code changes in plain English
- Context-Aware Assistance: The AI understands your codebase
- Integrated Chat: Ask questions about your code directly in the editor
UV is a fast, reliable Python package installer and resolver.
-
Windows (Run in PowerShell):
curl -sSf https://astral.sh/uv/install.ps1 | powershell
-
macOS/Linux:
curl -sSf https://astral.sh/uv/install.sh | sh
After installation, you may need to restart your terminal or add UV to your PATH.
UV offers several advantages over traditional pip:
- Speed: UV is 10-100x faster than pip
- Reliability: Better dependency resolution
- Compatibility: Works with pip's commands
- Safety: Written in a safe language
- Environment Management: The
uv run
command ensures everything runs in the correct environment
Here are some common UV commands to get you started:
Create a new virtual environment:
uv venv
Activate the virtual environment:
- On Windows (Command Prompt):
.venv\Scripts\activate
- On Windows (PowerShell):
.\.venv\Scripts\Activate.ps1
- On macOS/Linux:
source .venv/bin/activate
Install packages:
uv pip install <package-name>
Install from requirements file:
uv pip install -r requirements.txt
Run a Python script in the virtual environment:
uv run script.py
- Performance: If Cursor is running slowly, try closing other applications
- AI Features Not Working: Check your internet connection
- Editor Crashes: Make sure you have the latest version installed
- Installation Fails: Make sure you have the necessary permissions
- Command Not Found: Ensure UV is in your PATH
- Virtual Environment Issues:
- On Windows PowerShell: use
.\.venv\Scripts\Activate.ps1
- On Windows Command Prompt: use
.venv\Scripts\activate
- On macOS/Linux: use
source .venv/bin/activate
- On Windows PowerShell: use
For more help with UV, refer to the official UV documentation.
Happy coding! 💻✨