MoleditPy PySCF Calculator Plugin Tutorial

0. Setup Guide

(Mac / Linux / Windows WSL)

Objective

This guide covers the installation and setup of MoleditPy and the PySCF Calculator plugin. Since PySCF may have compatibility issues on native Windows, we provide specific instructions for Windows Subsystem for Linux (WSL) in addition to standard Mac/Linux setup.

1. For Mac / Linux Users

You can install the application directly into your standard Python environment.

Step 1: Install MoleditPy

  1. Open your terminal and run the following command to install the package:
    pip install moleditpy-installer

    * On recent Linux distributions (e.g., Ubuntu 24.04), you may need to add the --break-system-packages flag if you encounter an error.

    (Alternative) Using a virtual environment
    If you prefer not to modify your system packages, create a virtual environment:
    python3 -m venv myenvsource myenv/bin/activatepip install moleditpy-installer

    * Check the installation log. If you see a warning "WARNING: The script moleditpy-installer is installed in ... which is not on PATH", please use that full path.

  2. Add the local binary path to your shell configuration (Recommended):
    echo 'export PATH=$PATH:~/.local/bin' >> ~/.bashrcsource ~/.bashrc

    * This ensures you can run commands like `moleditpy` and `moleditpy-installer` directly.

  3. Create the desktop shortcut:
    moleditpy-installer

    * If the command is not found (and you haven't set PATH), check the pip install log for the full path (e.g. ~/.local/bin/moleditpy-installer).

  4. Launch the application to verify installation (first run may take a moment):
    moleditpy

Step 2: Install PySCF Calculator Plugin

  1. Install required libraries:
    pip install pyscf geometric matplotlib

    * If you encounter an error on recent Linux, please add --break-system-packages.

  2. Download the plugin from the Plugin Explorer.
  3. Unzip the downloaded file and place the pyscf_calculator folder into your plugins directory:
    • Mac/Linux: ~/.moleditpy/plugins/
  4. Restart MoleditPy. Go to Extensions > PySCF Calculator in the menu to verify it loads.

2. For Windows Users (via WSL)

We strongly recommend using Windows Subsystem for Linux (WSL) to run PySCF on Windows for stability. (Note: Windows 11 or the latest Windows 10 is required for GUI app support via WSLg)

Step 1: Setup WSL

  1. Open PowerShell as Administrator and run:
    wsl --install

    * You may need to restart your computer. After restarting, create a username and password for Ubuntu.

  2. Open the Ubuntu terminal and update package lists:
    sudo apt update
  3. Install required system libraries for GUI apps (PyQt6):
    sudo apt install python3-pip \libgl1 libegl1 libxkbcommon-x11-0 libdbus-1-3 \libxcb-cursor0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 \libxcb-randr0 libxcb-render-util0 libxcb-shape0 libxcb-xinerama0
  4. Set the Qt platform environment variable (Recommended for stability):
    echo 'export QT_QPA_PLATFORM=xcb' >> ~/.bashrcsource ~/.bashrc

Step 2: Install MoleditPy & Plugin

Run these commands inside your WSL (Ubuntu) terminal.

  1. Install MoleditPy:
    pip install moleditpy-installer --break-system-packages

    * The --break-system-packages flag is required on recent Linux distributions (e.g., Ubuntu 24.04).

    (Alternative) Using a virtual environment
    If you prefer not to modify your system packages, create a virtual environment:
    python3 -m venv myenvsource myenv/bin/activatepip install moleditpy-installer
  2. Install PySCF & dependencies:
    pip install pyscf geometric matplotlib --break-system-packages

    * If you are using a virtual environment, you can omit --break-system-packages.

  3. Install the Plugin:
    • Download and unzip the plugin from Plugin Explorer.
    • Access the WSL plugin folder from Windows Explorer and copy the pyscf_calculator folder into it.

      You can access it by typing \\wsl$\Ubuntu\home\YourName\.moleditpy\plugins\ in the address bar or via "Linux" in the navigation pane.

      (Ensure the directory exists first)

      mkdir -p ~/.moleditpy/plugins
  4. Launch:
    moleditpy

    MoleditPy will launch as a Linux GUI application via WSL.