-
Notifications
You must be signed in to change notification settings - Fork 2
Installation
This guide covers various ways to install PyPositron and common installation scenarios.
pip install py-positronIn 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_positronAfter that, you need to install either GTK or QT.
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/Ubuntusudo dnf install gcc gobject-introspection-devel cairo-gobject-devel pkg-config python3-devel gtk4
# In Fedora/CentOS/RHELThen, install the PyGObject Python library
pip install PyGObjectIf 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 startComplete 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
guiparameter to control which framework is used. Example:
positron.openUI("views/index.html",main,...,gui="qt") #Or gui="gtk"- Python 3.7 or higher
- Operating System: Windows, Linux, or macOS (untested)
- Internet connection (for downloading 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)
To verify your installation, run:
positronThis should display the help text of PyPositron.
Issue: positron command not found
Solution: Ensure Python's Scripts directory is in your PATH, or use:
python -m py_positron --versionIssue: Permission denied errors
Solution: Use --user flag or virtual environment:
pip install --user py-positronIssue: SSL certificate errors Solution: Upgrade pip and certificates:
pip install --upgrade pip certifi
pip install py-positronFor more installation troubleshooting, see Troubleshooting.