NXOpen Python Setup: The Short Version
NXOpen Python setup means NX loads its own interpreter, not the Python on your PATH. Set the journal language to Python, keep journals in a folder your team owns, pin Designcenter 2606, and play a short journal from Tools > Automation > Journal. inteliScience does this daily for DACH seats from Romania (EET is CET+1).
The Problem: NX Does Not Use the Python on PATH
NXOpen Python setup breaks when someone writes a .py file, hits Run in an editor, and NXOpen is missing. NX never promised that. Journals run inside the NX process. The interpreter is the one NX started with, the language is a Customer Default, and the file lives wherever NX last recorded, unless you set a directory on purpose.
We see the same three misses on DACH seats. Journal language is still Visual Basic from the last session. The engineer pip-installed packages into a venv NX cannot see. The .py sits on a desktop that no colleague, and no CAD admin, will ever find.
Language choice is a different article. For Python versus C# on NX Open, use the language comparison we already published. This post is the Python seat that actually plays.
Our recommendation: treat the first successful Play as a setup test, not as a tool. If it only runs on one workstation, you have a proof, not a process.
Pin Designcenter 2606 Before You Write a Line
Pin the NX release first. A journal that plays on 2412 can fail on 2606 for reasons that have nothing to do with Python syntax. inteliScience writes NX Open against the version the shop actually runs, then keeps that version in the repo next to the .py files.
Siemens made Designcenter June 2026 available to download on 23 June 2026 (Jamie Tyler, Designcenter blog). That release is NX 2606. We pin client work to 2606 unless the plant is still on 2506 or 2512 and cannot move yet.
On 16 July 2026 Siemens Community posted Community Conversations: NXOpen best practices and libraries. Use that session for libraries and habits. Do not paste version-specific snippets from an older video into a 2606 seat.
We would advise against mixing 2412, 2506, and 2606 journals in one unlabeled folder. Record Help > About from the machine that will Play the journal, and put that string in the commit. If About and the plant standard disagree, stop and pick one.
Journal Language and the NX Journal Directory
The NX journal directory is not a hidden Windows trick. It is the folder NX uses when you Record or Play. Set the language to Python and set that folder to a location the CAD admin owns. User Interface preferences are saved per user. Customer Defaults set the baseline for every seat.
Do this in order:
- File > Preferences > User Interface, Journal language: Python (your user preference; it overrides the default).
- File > Utilities > Customer Defaults > Gateway > User Interface > Journal tab, same language (survives restart).
- Under Customer Defaults > Gateway > General > Directories, set Journal Directory to a shared folder your CAD admin controls. Do not leave it on a personal desktop.
- Confirm persistence: exit NX, start NX, open Customer Defaults again. If the language bounced back, the site defaults are locked. Talk to the CAD admin, do not fight the dialog.
- Confirm the folder: Record a dummy journal, then look at where NX wrote the file. That is the directory NX is using, not a path copied from a blog.
Siemens documents recording and playback under Recording NX sessions. Play is Menu > Tools > Automation > Journal > Play. Some ribbons also expose Play on the Developer tab.
| Setting | Lives in | Survives NX restart |
|---|---|---|
| Journal language (this session) | File > Preferences > User Interface | Yes, per user (overrides the default) |
| Journal language (site or user default) | Customer Defaults > Gateway > User Interface > Journal | Yes, if your level can write defaults |
| Journal directory | Customer Defaults > Gateway > General > Directories, then verify by recording | Yes, once defaults save |
If you need the defaults file NX loaded, open Help > Log File and search for dpv. Read the path NX prints. We do not publish a guessed AppData location because installs and site policies differ.
Clear recommendation: one shared journal directory per NX version, named with the release (for example journals-2606), with write access for authors and read access for testers. Two folders for two versions. Never one pile.
Confirm Which Python Interpreter NX Loads
Print sys.version and sys.executable from a journal Played inside NX. That is the interpreter NX loaded. If those lines do not match the Python you use in VS Code, NX is not using your venv, and pip install on PATH will not help.
# Play from Tools > Automation > Journal. Do not run this in VS Code.
import sys
import NXOpen
def main():
session = NXOpen.Session.GetSession()
lw = session.ListingWindow
lw.Open()
lw.WriteLine("sys.version: " + sys.version)
lw.WriteLine("sys.executable: " + sys.executable)
lw.WriteLine("sys.prefix: " + sys.prefix)
lw.WriteLine("NXOpen loaded from: " + getattr(NXOpen, "__file__", "(builtin)"))
if __name__ == "__main__":
main()
Copy those listing-window lines into the ticket. That is your pin. An external distribution is optional. When you need a package NX does not ship, Siemens documents UGII_PYTHON_LIBRARY_DIR, UGII_PYTHONPATH, and UGII_PYTHON_DLL (NX Open Programmer’s Guide, “Use external Python distribution”). Match the minor version NX printed. A 3.13 install next to a 3.12 NX interpreter is a common “cannot initialize Python interpreter” failure.
Leave ugii_env.dat edits to the CAD admin. The install root is UGII_BASE_DIR on that machine. Guessing a C:\... path is how journals get committed with a location that exists on one laptop.
Stubs are a separate installer option. Since NX 2312, Python stubs ship when Programming Tools is selected. Point the editor at UGII_BASE_DIR\UGOPEN\pythonStubs. That is IntelliSense only. Journals still Play inside NX. The public NX Open Python Reference Guide currently indexes as NX 2406 Series. Confirm class names against the help that shipped with 2606.
The First NX Open Python Journal That Runs
A working first journal imports NXOpen and NXOpen.UF, grabs the session the same way a recording does, writes one line to the listing window, and is Played from NX. If that file fails, fix setup. Do not add geometry builders on top of a broken interpreter.
# Minimal NX Open Python journal (recorded-journal import shape).
# Play: Tools > Automation > Journal > Play
import NXOpen
import NXOpen.UF
def main():
theSession = NXOpen.Session.GetSession()
theUfSession = NXOpen.UF.UFSession.GetUFSession()
workPart = theSession.Parts.Work
displayPart = theSession.Parts.Display
lw = theSession.ListingWindow
lw.Open()
lw.WriteLine("NXOpen Python setup: journal ran inside NX.")
if workPart is not None:
lw.WriteLine("Work part: " + workPart.Name)
else:
lw.WriteLine("No work part. Open a part, then Play again.")
_ = theUfSession
_ = displayPart
if __name__ == "__main__":
main()
Save it in the journal directory you set. Open a part. Play. You want two listing-window lines and no interpreter dialog. theUfSession is acquired the way a Python recording writes it, even if this file never calls UF.
If Play says NXOpen cannot be imported, you ran the file outside NX. If Python cannot initialize, the external-interpreter variables or the minor version are wrong. If the language is wrong, the Journal tab is still on Visual Basic.
This runs as a POC. What’s missing for production: a shared journal directory the CAD admin owns, an NX 2606 pin every seat matches, menus so people never open the Journal Editor, Teamcenter-aware errors, and an owner after the author changes teams. We close the gap from a journal that plays on one seat to a tool the department can run. How we ship production NXOpen tools
Frequently Asked Questions
How much does NXOpen Python setup cost?
The bundled interpreter is already on the NX seat, so setup cost is engineer time, not a Python SKU. Plan half a day to pin the version, set Customer Defaults, prove Play, and write the listing-window check into the team wiki. Shipping a Python toolkit to other seats is a license question (NX Open Python Author / toolkits), which we quote only after we see the seats. Do not budget a compiler for a journal.
NX bundled Python vs an external interpreter: which should we use?
Use the bundled interpreter until a package NX does not ship is a real requirement. Then point NX at an external distribution whose minor version matches sys.version from the journal above, using the Programmer’s Guide variables, not a random install from python.org. We’d advise against letting each developer point NX at a personal venv.
Where is the NX journal directory?
It is the Journal Directory on the Directories tab of Customer Defaults (Gateway > General), verified by recording a dummy file and seeing where NX wrote it. User Interface Preferences can override the default. If you need the defaults file itself, Help > Log File, search for dpv, and read the path NX loaded.
Why does Visual Studio Code underline NXOpen?
Because the editor is not NX. Add UGII_BASE_DIR\UGOPEN\pythonStubs to the editor extra paths after Programming Tools is installed (stubs ship from NX 2312). Underlines going away does not mean you can Run the file from the editor. Play stays inside NX.
Do we need Programming Tools to run a Python journal?
No. Journals Play with a normal NX install. Programming Tools adds UGOPEN samples and pythonStubs for the editor. If those folders are missing, rerun the installer with Programming Tools checked. Missing stubs is an editor problem. A missing interpreter is an NX configuration problem.
Next Step
If the listing window printed sys.version and the minimal journal named the work part, setup is done. The next conversation is how that file becomes a command other engineers will still run in 2027, on the NX versions you actually have, with an owner. inteliScience runs that as NX Open delivery from Romania for DACH teams.

