Skip to content

Installation for Linux

Hiromichi Yokoyama edited this page Aug 4, 2026 · 4 revisions

Installation Guide for Linux

On Linux, MoleditPy is distributed as a separate package, moleditpy-linux, which ships with Open Babel disabled. This avoids segmentation faults caused by conflicts between Open Babel's native libraries and the system/Qt libraries on many distributions — this is still the current, recommended package for Linux (the plain moleditpy PyPI package is built for Windows/macOS only). Because Open Babel is unavailable, 2D-to-3D conversion and force-field optimization on Linux always use the RDKit backend (or Direct mode); see Tips for 2D-to-3D conversion.

MoleditPy supports Python 3.9 through 3.14 (requires-python = ">=3.9, <3.15"). On Python 3.9 specifically, PyQt6 is pinned to <6.10 (all other supported versions use <6.12); pip resolves this automatically.

Prerequisites

  • Python 3.x is installed.
  • pip and venv are available.

Method A: moleditpy-installer (Recommended)

moleditpy-installer installs moleditpy-linux automatically (it detects Linux via sys_platform == 'linux') and can register an application-menu .desktop entry, a Desktop shortcut, and the .pmeprj MIME type/file association.

  1. Create and activate a virtual environment (recommended, keeps the install isolated):
    python3 -m venv moleditpy
    source moleditpy/bin/activate
  2. Install the installer (this pulls in moleditpy-linux as a dependency):
    pip install moleditpy-installer
  3. Install the system dependency needed for Qt:
    sudo apt install libxcb-cursor0   # Debian/Ubuntu based systems
  4. Run the installer:
    moleditpy-installer
    In an interactive terminal this opens a TUI where you pick the components (Desktop shortcut, application-menu entry, .pmeprj file association) and scope (per-user ~/.local/share/applications, honoring XDG_DATA_HOME, or system-wide /usr/share/applications with sudo moleditpy-installer --system). For scripted use: moleditpy-installer --no-tui. The launcher runs in a terminal window so output/errors stay visible.
  5. Launch:
    moleditpy

See the moleditpy-installer README for the full option list, or Shortcut (Linux) to build the .desktop entry manually.

Method B: Manual venv + pip

  1. Create and activate a virtual environment
    Open a terminal and run the following commands to create and activate a new virtual environment named moleditpy.

    python3 -m venv moleditpy  
    source moleditpy/bin/activate
  2. Install the package
    Install the dedicated Linux package using pip.

    pip install moleditpy-linux
  3. Install system dependencies
    This OS-level library might be required for Qt to function correctly.
    # For Debian/Ubuntu based systems

    sudo apt install libxcb-cursor0
  4. Run the application
    You can now launch the application by typing its name in the terminal.

    moleditpy  

    Confirm the installed version with moleditpy --version.

Upgrading and Uninstalling

pip install --upgrade moleditpy-linux
moleditpy-installer --uninstall   # if you used the installer for shortcuts/MIME registration
pip uninstall moleditpy-linux

Raspberry Pi

If MoleditPy crashes on launch or fails to render on Raspberry Pi OS, see Troubleshooting Launch Issues on Raspberry Pi.

Clone this wiki locally