The Python installation delivered with NX (%UGII_BASE_DIR%\ugii\python) contains only core modules, so imports for extensions such as numpy and scipy will not work.
To use these modules, you need a standalone Python installation with the modules installed. NX uses the following environment variables:
An example of these set to use the Python installation delivered with NX is:
PYTHONPATH=C:\apps\Siemens\NX\10.0\UGII\python UGII_PYTHON_HOME=C:\apps\Siemens\NX\10.0\UGII\python UGII_PYTHON_DLL=python33.dll UGII_PYTHON_LIBRARY_DIR=C:\apps\Siemens\NX\10.0\UGII\python UGII_PYTHONPATH=C:\apps\Siemens\NX\10.0\UGII\python;C:\apps\Siemens\NX\10.0\UGII\python\Python33.zip TCL_LIBRARY=C:\apps\Siemens\NX\10.0\UGII\python\tcl8.5
Setup to use a standalone Python installation:
PYTHONPATH=C:\apps\Python\33;C:\apps\Python\33\Lib;C:\apps\Python\33\libs;C:\apps\Python\33\DLLs;C:\apps\Siemens\NX\10.0\UGII\python UGII_PYTHON_HOME=C:\apps\Python\33 UGII_PYTHON_DLL=python33.dll UGII_PYTHON_LIBRARY_DIR=C:\Windows\System32 UGII_PYTHONPATH=C:\apps\Python\33;C:\apps\Python\33\Lib;C:\apps\Python\33\libs;C:\apps\Python\33\DLLs;C:\apps\Siemens\NX\10.0\UGII\python TCL_LIBRARY=C:\apps\Python\33\tcl\tcl8.5
When using a .net language, you must have an author license to use other "libraries"; without an author license you are limited to the NX dll's and some of the core .net dll's. Is there a similar limitation with Python?
These environment variables worked fine
PYTHONPATH=C:\Program Files\Siemens\NX 10.0\UGII\python UGII_PYTHON_HOME=C:\Program Files\Siemens\NX 10.0\UGII\python UGII_PYTHON_DLL=python33.dll UGII_PYTHON_LIBRARY_DIR=C:\Program Files\Siemens\NX 10.0\UGII\python UGII_PYTHONPATH=C:\Program Files\Siemens\NX 10.0\UGII\python;C:\Program Files\Siemens\NX 10.0\UGII\python\Python33.zip TCL_LIBRARY=C:\Program Files\Siemens\NX 10.0\UGII\python\tcl8.5
Then I installed Python 3.3.2 and Numpy 1.10.2. I wasn't able to find a version of Anaconda specifically for 3.3.2. Haven't looked into Win Python yet.
Next, I tried these environment variables and I get a "General Fault Exception" error.Should UGII_Python_Library be set differently?
PYTHONPATH= C:\Python33;C:\Python33\Lib;C:\Python33\libs;C:\Python33\DLLs;C:\Program Files\Siemens\NX 10.0\UGII\python TCL_LIBRARY=C:\Python33\tcl\tcl8.5 UGII_PYTHON_HOME=C:\Python33 UGII_PYTHONPATH= C:\Python33;C:\Python33\Lib;C:\Python33\libs;C:\Python33\DLLs;C:\Program Files\Siemens\NX 10.0\UGII\python UGII_PYTHON_DLL=python33.dll UGII_PYTHON_LIBRARY_DIR =C:\Windows\System32
@AlexLee: You can certainly try
Siemens PLM only tests/supports the documented release. Similar releases (i.e. 3.3.5) will probably work with the standard caveat that it's based on the packages upward compatibility claims.
2.7 will definitely not work.
@JimB Thanks for your detailed responses. I would not have gotten this far without them!
C:/Windows/System32 strangely enough does not have a python33.dll
I did use the same installer in that link (Python 3.3.2 x86 non 64 bit)
I just tried setting UGII_PYTHON_LIBRARY_DIR=C:\Python33\Lib;C:\Python33\libs
but that did not work either.