You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu 20.04安装SALOME-9.8报错:No module named '_omnipy'求助

Fixing "ModuleNotFoundError: No module named '_omnipy'" when starting SALOME 9.8 on Ubuntu 20.04

Hey there, this error is super common when SALOME's bundled dependencies clash with system-wide or Anaconda-managed Python environments. Let's break down why this happens and how to fix it step by step:

Why this happens

SALOME 9.8 ships with its own version of Python, omniORB, and other critical libraries. When Anaconda is installed, it modifies your PATH and PYTHONPATH environment variables to prioritize its own Python interpreter. This means SALOME tries to use Anaconda's Python instead of its bundled one, and Anaconda's Python can't find the private _omnipy module that comes with SALOME's omniORB.

Solutions to try

1. Temporarily disable Anaconda before launching SALOME

This is the quickest test to confirm if Anaconda is the culprit. Open a new terminal and run these commands:

# Unset Anaconda-related environment variables
unset PYTHONPATH
unset CONDA_PREFIX
# Refresh your shell config (use ~/.zshrc if you're on Zsh)
source ~/.bashrc
# Navigate to your SALOME installation directory
cd /home/$USER/Downloads/SALOME-9.8.0-native-UB20.04-SRC/BINARIES-UB20.04/SALOME
# Launch SALOME
./salome

2. Force SALOME to use its bundled Python

If the first method works, you can directly call SALOME's own Python interpreter to avoid environment conflicts:

# Replace the paths with your actual SALOME installation paths
/home/$USER/Downloads/SALOME-9.8.0-native-UB20.04-SRC/BINARIES-UB20.04/Python/bin/python3.8 \
/home/$USER/Downloads/SALOME-9.8.0-native-UB20.04-SRC/BINARIES-UB20.04/SALOME/bin/salome/salome

3. Ensure SALOME's library paths are prioritized

The _omnipy module is a C extension that needs access to SALOME's omniORB libraries. Set the LD_LIBRARY_PATH before launching:

export LD_LIBRARY_PATH=/home/$USER/Downloads/SALOME-9.8.0-native-UB20.04-SRC/BINARIES-UB20.04/omniORB/lib:$LD_LIBRARY_PATH
# Now launch SALOME
cd /path/to/your/SALOME/SALOME
./salome

4. Permanently modify the SALOME startup script

To avoid running these commands every time, edit the SALOME startup script to isolate its environment:

  1. Open the salome script in your SALOME directory with a text editor:
    nano /home/$USER/Downloads/SALOME-9.8.0-native-UB20.04-SRC/BINARIES-UB20.04/SALOME/salome
    
  2. Add these lines at the very top of the script:
    # Isolate from Anaconda environment
    unset PYTHONPATH
    unset CONDA_PREFIX
    
    # Set SALOME's library path
    SALOME_ROOT="/home/$USER/Downloads/SALOME-9.8.0-native-UB20.04-SRC/BINARIES-UB20.04"
    export LD_LIBRARY_PATH="$SALOME_ROOT/omniORB/lib:$LD_LIBRARY_PATH"
    
    # Prioritize SALOME's bundled Python
    export PATH="$SALOME_ROOT/Python/bin:$PATH"
    
  3. Save the file and close it. Now you can launch SALOME normally with ./salome without environment conflicts.

内容的提问来源于stack exchange,提问作者CHEN Duanwu

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.28 17:32:27