PyPositron Docs

Troubleshooting

This section provides solutions to common issues encountered while using PyPositron.

Installation Issues

Problem: PyPositron fails to install

Solution: Ensure you have the latest version of pip installed:

pip install --upgrade pip

If the issue persists, try installing PyPositron in a manual virtual environment:

python -m venv venv
source venv/bin/activate
pip install py-positron

Runtime Errors

Problem: FileNotFoundError for frontend/index.html

Solution: Ensure the frontend/index.html file exists in your project directory. If it is missing, create a new HTML file at that location or copy the default index.html from the PyPositron repository.

Problem: RuntimeError: openUI must be called from the main thread

Solution: Ensure that the openUI function is called from the main thread. Avoid calling it from background threads.

Virtual Environment Issues

Problem: Virtual environment activation fails

Solution: On Linux/macOS, use the following command to activate the virtual environment:

source venv/bin/activate

On Windows, use:

venv\Scripts\activate

If activation still fails, recreate the virtual environment:

python -m venv venv

UI Issues

Problem: UI does not load

Solution: Check the backend/main.py file for errors. Ensure that the openUI function is correctly configured to load the frontend/index.html file.

Problem: JavaScript errors in the browser console

Solution: Debug the JavaScript code in your frontend/index.html file. Use the browser's developer tools to identify and fix errors.

Other Issues

If you encounter issues not listed here, consult the PyPositron GitHub repository for additional support or open a new issue.