---
Product: barcode
Platform: python
Page Type: docs
Canonical URL: https://docs.aspose.org/barcode/python/getting-started/installation
---

# Installation

Install Aspose.BarCode FOSS for Python via pip, verify the installation, set up a virtual environment, and generate your first barcode.

## Installation of Aspose.BarCode FOSS for Python

Aspose.BarCode FOSS for Python is a pure-Python package. There are no native extensions to compile, no system libraries to install, and no third-party runtime required.

---

### Prerequisites

| Requirement | Detail |
|-------------|--------|
| Python version | 3.12 or later |
| Package manager | pip (bundled with CPython) |
| Operating system | Windows, macOS, Linux (any platform that runs CPython) |
| Compiler / build tools | None required |
| System packages | None required |

---

### 1. Install via pip

Install Aspose.BarCode FOSS using the command below:

```bash
git clone https://github.com/aspose-barcode-foss/Aspose.BarCode-FOSS-for-Python.git
cd Aspose.BarCode-FOSS-for-Python
pip install -e .
```

pip will download and install the package. No post-install configuration is needed.

To install a pinned version for reproducible builds:

```bash
git clone https://github.com/aspose-barcode-foss/Aspose.BarCode-FOSS-for-Python.git
cd Aspose.BarCode-FOSS-for-Python
pip install -e .
```

---

### 2. Set Up a Virtual Environment

Using a virtual environment keeps the library isolated from other Python projects.

**Create and activate a virtual environment:**

```bash
# Create the environment
python -m venv .venv

# Activate on Linux / macOS
source .venv/bin/activate

# Activate on Windows (Command Prompt)
.venv\Scripts\activate.bat

# Activate on Windows (PowerShell)
.venv\Scripts\Activate.ps1
```

**Install the library inside the activated environment:**

```bash
git clone https://github.com/aspose-barcode-foss/Aspose.BarCode-FOSS-for-Python.git
cd Aspose.BarCode-FOSS-for-Python
pip install -e .
```

**Record dependencies for reproducibility:**

```bash
pip freeze > requirements.txt
```

---

### 3. Verify the Installation

After installing, verify that the library imports correctly:

```python
import aspose_barcode_foss as barcode

bc = barcode.code128("TEST")
print(f"Generated barcode with {bc.symbol.matrix.width}x{bc.symbol.matrix.height} modules")
```

You can also check the installed version with pip:

```bash
pip show aspose-barcode-foss
```

This prints the version, author, and license (MIT).

---

### Quick Start: Generate a Barcode

The following script generates a Code 128 barcode and saves it as SVG:

```python
import aspose_barcode_foss as barcode
from aspose_barcode_foss import RenderOptions

bc = barcode.code128("Hello World")
svg = bc.to_svg(options=RenderOptions(show_text=True))

with open("barcode.svg", "w") as f:
    f.write(svg)
print("Saved barcode.svg")
```

Generate a QR code and save it as PNG:

```python
import aspose_barcode_foss as barcode
from aspose_barcode_foss import QrOptions, QrErrorCorrectionLevel

bc = barcode.qr(
    "https://example.com",
    encode=QrOptions(error_correction_level=QrErrorCorrectionLevel.H),
)

with open("qr.png", "wb") as f:
    f.write(bc.to_png())
print("Saved qr.png")
```

---

### Platform Notes

**Windows, macOS, Linux:** The library is identical on all platforms. There are no platform-specific code paths or binary extensions.

**Docker / serverless:** Because there are no system-package dependencies, the library works inside slim Docker images (such as `python:3.12-slim`) without installing additional packages.

**CI/CD:** Build the package from source in your CI pipeline's dependency step. No additional setup is required beyond that.

---

### Next Steps

- [Quickstart](../quickstart/): First working barcode with encode and render options
- [License](../license/): MIT license details
- [Developer Guide](../../developer-guide/): Per-symbology encode options, rendering controls, and code examples

## See Also

- [Aspose.BarCode for Python — Enterprise Documentation](https://docs.aspose.com/barcode/python-net/)