{"id":8376,"library":"openseespylinux","title":"OpenSeesPy (Linux)","description":"OpenSeesPy is a Python wrapper for the OpenSees finite element analysis framework, widely used for simulating structural and geotechnical systems. The `openseespylinux` package provides a pre-compiled, optimized version of OpenSeesPy specifically for Linux environments, enabling high-performance numerical simulations without needing to compile OpenSees from source. It is currently at version 3.8.0.0 and typically updates in alignment with major OpenSees releases.","status":"active","version":"3.8.0.0","language":"en","source_language":"en","source_url":"https://github.com/zhuminjie/openseespy","tags":["finite element","structural analysis","engineering","simulation","linux-only","opensees"],"install":[{"cmd":"pip install openseespylinux","lang":"bash","label":"Install for Linux"}],"dependencies":[],"imports":[{"note":"The core OpenSees commands are exposed via the `opensees` submodule, aliased as `ops` by convention.","wrong":"import openseespy","symbol":"ops","correct":"import openseespy.opensees as ops"}],"quickstart":{"code":"import openseespy.opensees as ops\n\n# 1. Start a new model (2D, 3 DoF per node)\nops.wipe()\nops.model('basic', '-ndm', 2, '-ndf', 3)\n\n# 2. Define a uniaxial elastic material (tag 1, E=3000)\nops.uniaxialMaterial('Elastic', 1, 3000.0)\n\n# 3. Define nodes\nops.node(1, 0.0, 0.0)\nops.node(2, 10.0, 0.0)\n\n# 4. Define boundary conditions (fixed at node 1)\nops.fix(1, 1, 1, 1)\n\n# 5. Define an elastic truss element (tag 1, nodes 1-2, Area=1.0, material tag 1)\nops.element('Truss', 1, 1, 2, 1.0, 1)\n\n# 6. Define a time series (constant) and load pattern\nops.timeSeries('Constant', 1)\nops.pattern('Plain', 1, 1)\nops.load(2, 0.0, -100.0, 0.0) # Apply 100 units downward load at node 2\n\n# 7. Define analysis parameters\nops.integrator('LoadControl', 0.1)\nops.numberer('RCM')\nops.constraints('Plain')\nops.system('BandGeneral')\nops.algorithm('Newton')\nops.analysis('Static')\n\n# 8. Perform analysis in 10 steps\nops.analyze(10)\n\n# 9. Get results (Y-displacement of node 2)\ndisp_y = ops.nodeDisp(2, 2)\nprint(f\"Y-displacement at node 2: {disp_y}\")\n\n# 10. End model and clear memory\nops.wipe()","lang":"python","description":"This example demonstrates a basic static analysis of a simple truss element, including model definition, material/element assignment, boundary conditions, loading, analysis, and result retrieval. It's crucial to call `ops.wipe()` before defining a new model."},"warnings":[{"fix":"Ensure you are using a Linux environment (native, WSL, Docker, or VM) for installation and execution. For other operating systems, consider `openseespy` (if available for your OS) or building from source.","message":"The `openseespylinux` package is strictly for Linux operating systems. Attempting to install or run it on Windows or macOS will result in `ImportError` or `OSError` due to incompatible binaries.","severity":"breaking","affected_versions":"All versions"},{"fix":"Verify your active Python version (`python --version`) and ensure it is 3.12 or greater. Use a virtual environment to manage Python versions if necessary.","message":"`openseespylinux` requires Python 3.12 or newer. Installing with older Python versions will likely lead to `ModuleNotFoundError` or other runtime `ImportError` issues.","severity":"breaking","affected_versions":"All versions"},{"fix":"Always use `import openseespy.opensees as ops` to ensure access to all OpenSees commands (e.g., `ops.model()`, `ops.node()`).","message":"The standard and correct way to access OpenSees commands is `import openseespy.opensees as ops`. A common mistake is to simply use `import openseespy`, which does not expose the command API directly.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always include `ops.wipe()` as the very first command when defining a new OpenSees model.","message":"It is critical to call `ops.wipe()` at the beginning of any new model definition or before running multiple independent analyses within the same Python script. Failure to do so can lead to unintended interactions and incorrect results from previously defined model components.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Activate the correct Python environment (Python 3.12 or newer) and run `pip install openseespylinux`.","cause":"The `openseespylinux` package was not installed, or the Python environment where it was installed is not active, or an incompatible Python version is used.","error":"ModuleNotFoundError: No module named 'openseespy'"},{"fix":"Use a Linux environment (native, WSL, Docker, or VM) for `openseespylinux`. For other OS, seek platform-specific distributions or build OpenSeesPy from source.","cause":"Attempting to install or run `openseespylinux` on a non-Linux operating system (e.g., Windows, macOS). This package is Linux-specific.","error":"ImportError: DLL load failed while importing opensees"},{"fix":"Ensure you are running the `openseespylinux` package strictly within a compatible Linux environment matching the architecture (e.g., x86_64).","cause":"This error occurs when trying to run the Linux-compiled binaries (e.g., an `.so` file) on a non-Linux system or a system with an incompatible architecture.","error":"OSError: [Errno 8] Exec format error: '/path/to/openseespy/opensees.cpython-312-x86_64-linux-gnu.so'"},{"fix":"Change your import from `import openseespy` to `import openseespy.opensees as ops` to correctly access the OpenSees command API.","cause":"Incorrect import statement. The `openseespy` module itself does not expose the OpenSees commands directly; they are nested in the `opensees` submodule.","error":"AttributeError: module 'openseespy' has no attribute 'model'"}]}