eth-ait / aitviewer

A set of tools to visualize and interact with sequences of 3D data.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Installation Issue on macOS with Apple Silicon

smueksch opened this issue · comments

When trying to install aitviewer on a machine running macOS with AppleSilicon (M1 Pro), the PyQT5 dependency causes issues by seemingly being stuck in an infinite loop during installation, see Pip Install stuck on "Preparing Wheel metadata..." when trying to install PyQT5.

I have documented steps on how I was able to get around this issue and create a virtual environment with aitviewer installed in it:

  1. First, install Python 3.8 and PyQT5 using Homebrew:

    brew install python@3.8
    brew install pyqt@5

    and ensure they necessary paths are discoverable:

    echo 'export PATH="/opt/homebrew/opt/qt@5/bin:$PATH"' >> ~/.zshrc
    echo 'export PATH="/opt/homebrew/opt/pyqt@5/5.15.4_1/bin:$PATH"' >> ~/.zshrc
    source ~/.zshrc
    
  2. Then, create an environment with system site packages (for PyQT5):

    python3.8 -m venv --system-site-packages <ENV_PATH>

    Activate the environment with:

    source <ENV_PATH>/bin/activate
  3. Install the pyqt5 manually by first upgrading pip:

    python -m pip install --upgrade pip

    N.B.: Some older versions of pip don't support some of the settings
    required below, hence the upgrade.

    Then install pyqt5 with:

    python -m pip install pyqt5 --config-settings --confirm-license= --verbose

    N.B.: This method avoids the issue of installation being stuck:
    Pip Install stuck on "Preparing Wheel metadata..." when trying to install PyQT5 - Stack Overflow

    N.B.: This step still may take up to 30 minutes to complete.

  4. Install aitviewer:

    python -m pip install aitviewer
    

Thanks for reporting this. If anyone else is experiencing a similar issue in the future, but these instructions don't help, feel free to re-open the issue.

xcode-select --install
also is required to install. I think it's required on Mac include Intel.

v1.12.0 now supports PyQt6, which makes it easier to install on MacOS. To use PyQt6, install as follows:

AITVIEWER_INSTALL_PYQT6=1 pip install --no-binary=aitviewer aitviewer

Then configure the viewer to use PyQt6, e.g. from code:

from aitviewer.configuration import CONFIG as C
C.window_type = "pyqt6"

For other ways to configure this (i.e. via configuration file), check the docs here.