PyPositron Docs

Installation Guide

This guide covers various ways to install PyPositron and common installation scenarios.

Basic Installation on windows

pip install py-positron

Installation on Linux

In Linux, you usually need a virtual environment to install packages. First, navigate to your desired project directory. Then, use the following commands:

python -m venv linuxvenv # This may take some time
source linuxvenv/bin/activate
pip install py_positron

After that, you need to install either GTK or QT.

Installation with GTK

Complete the [previous steps](#Installation on Linux) first. Install the dependencies:

sudo apt install libgirepository-2.0-dev gcc libcairo2-dev pkg-config python3-dev gir1.2-gtk-4.0
# In Debian/Ubuntu
sudo dnf install gcc gobject-introspection-devel cairo-gobject-devel pkg-config python3-devel gtk4 
# In Fedora/CentOS/RHEL

Then, install the PyGObject Python library

pip install PyGObject

If you get build errors, make sure you installed all the previous packages correctly. If you get break-system-package errors, activate the virtual environment using source linuxvenv/bin/activate

Now, you should be able to start your project.

positron start #Or python3 -m positron start

Installation with QT

Complete the [previous steps](#Installation on Linux) first. Then, install the python packages QtPy, PyQt5, PyQtWebEngine

pip install QtPy PyQt5 PyQtWebEngine

You should be able to start your project now:

positron start

Note: You may see errors like "Couldn't import GTK". These should not affect anything. The error occurs because the library tries using GTK, then QT. Use the gui parameter to control which framework is used. Example:

positron.openUI("views/index.html",main,...,gui="qt") #Or gui="gtk"

System Requirements

  • Python 3.7 or higher
  • Operating System: Windows, Linux, or macOS (untested)
  • Internet connection (for downloading dependencies)

Dependencies

PyPositron automatically installs the following dependencies:

  • pywebview - For creating desktop applications with web technologies
  • pathlib2 - For enhanced path handling
  • packaging - For checking package version. However, more dependencies may need to be [manually installed in Linux](#Installation in Linux)

Verification

To verify your installation, run:

positron

This should display the help text of PyPositron.

Troubleshooting Installation

Common Issues

Issue: positron command not found Solution: Ensure Python's Scripts directory is in your PATH, or use:

python -m py_positron --version

Issue: Permission denied errors Solution: Use --user flag or virtual environment:

pip install --user py-positron

Issue: SSL certificate errors Solution: Upgrade pip and certificates:

pip install --upgrade pip certifi
pip install py-positron

For more installation troubleshooting, see Troubleshooting.