Python
This guide covers setting up Python development with Python and pip.
Installation
We recommend Python 3.12 or later.
- Windows
- macOS
- Linux
# Using winget
winget install Python.Python.3.12
# Or using Chocolatey
choco install python
Or download the installer from python.org.
# Using Homebrew
brew install python@3.12
# Add to PATH if needed
echo 'export PATH="/opt/homebrew/opt/python@3.12/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
# Ubuntu/Debian
sudo apt update
sudo apt install -y python3 python3-pip python3-venv
Verify Installation
python3 --version
pip3 --version
pip
pip is the package installer for Python. It handles dependency management from PyPI (Python Package Index).
Common pip Commands
# Install a package
pip install requests
# Install from requirements file
pip install -r requirements.txt
# Generate requirements file
pip freeze > requirements.txt
# Upgrade a package
pip install --upgrade requests
# Create a virtual environment
python -m venv venv
# Activate virtual environment (macOS/Linux)
source venv/bin/activate
# Activate virtual environment (Windows)
.\venv\Scripts\activate
Set Up pip with JFrog
- Go to https://p6m.jfrog.io
- Login
- Navigate to Profile → Set Me Up → PyPI
- Click Generate Token and Create Instructions
- Follow the instructions to configure your
pip.conforpip.ini:
- Windows
- macOS
- Linux
Create or edit %APPDATA%\pip\pip.ini:
[global]
index-url = https://your-username:your-token@p6m.jfrog.io/artifactory/api/pypi/pypi/simple
Create or edit ~/.pip/pip.conf:
[global]
index-url = https://your-username:your-token@p6m.jfrog.io/artifactory/api/pypi/pypi/simple
Create or edit ~/.pip/pip.conf:
[global]
index-url = https://your-username:your-token@p6m.jfrog.io/artifactory/api/pypi/pypi/simple
Related
- Python Official Documentation - Official Python documentation
- pip Configuration - Configure pip and PyPI