TIBCO Spotfire Analyst Python package build or installation error: Cannot open include file: 'Python.h': No such file or directory
book
Article ID: KB0072789
calendar_today
Updated On:
Products
Versions
Spotfire Analyst
10.0.0 and higher
Description
When attempting to build an SPK containing Python packages through the TIBCO Spotfire Analyst Python Interpreter from a command line prompt, it fails with the error: "Cannot open include file: 'Python.h': No such file or directory"
The same error also occur when attempting to install python packages to the Spotfire Analyst Python Interpreter from a command line prompt: -------------------------------- >"C:\Users\lizliu\AppData\Local\TIBCO\Spotfire\10.10.2\Modules\Python Interpreter_3.810.10300.14\python\python.exe" -m pip install cvxpy ........ scsmodule.c src/scsmodule.c(1): fatal error C1083: Cannot open include file: 'Python.h': No such file or directory {} {} error: Command "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DPYTHON -DCTRLC=1 -DDLONG=1 -DCOPYAMATRIX -Iscs/include -Iscs/linsys -Iscs/linsys/cpu/direct/ -Iscs/linsys/external/amd -Iscs/linsys/external/dqlql -IC:\Users\lizliu\AppData\Local\Temp\pip-build-env-cg0ot51u\overlay\Lib\site-packages\numpy\core\include -IC:\Users\lizliu\AppData\Local\TIBCO\Spotfire\10.10.2\Modules\Python Interpreter_3.810.10300.14\python\include -IC:\Users\lizliu\AppData\Local\TIBCO\Spotfire\10.10.2\Modules\Python Interpreter_3.810.10300.14\python\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include -IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt /Tcsrc/scsmodule.c /Fobuild\temp.win-amd64-3.8\Release\src/scsmodule.obj -O3" failed with exit status 2 --------------------------------
The cause is that the include file "Python.h" is required by Python to build or install python packages from source but the TIBCO Spotfire Analyst Python Interpreter does not have access to this out of the box.
Issue/Introduction
Attempting to build or install Python packages in TIBCO Spotfire Analyst results in the error "Cannot open include file: 'Python.h': No such file or directory". This can be addressed by copying the includes folder from an Open Source Python installation to the Spotfire Python Interpreter module folder.
Environment
All
Resolution
Shut down TIBCO Spotfire Analyst.
On the TIBCO Spotfire Analyst client machine, do an independent Open Source Python installation, using the same version as the Python Interpreter for your Spotfire Analyst client (for example, python interpreter 3.8.10 for Spotfire Analyst 11.4.0). Note: you can find that version number by looking at the Python Interpreter module in your Spotfire Modules folder, which is named Python Interpreter_[version number] - e.g. C:\Users\lizliu\AppData\Local\TIBCO\Spotfire\10.10.2\Modules\Python Interpreter_3.810.10300.14.
From the Python installation folder, copy the "include" folder (for example, C:\Python381\include) and paste it into the TIBCO Spotfire Analyst Python Interpreter directory (for example: C:\Users\lizliu\AppData\Local\TIBCO\Spotfire\11.4\Modules\Python Interpreter_3.810.10300.14\python).
Now, the Python Interpreter in TIBCO Spotfire Analyst can utilize the files (e.g. Python.h) located in the "include" folder you just added for building or installing Python packages from source.