How to install an external iron python library (Ex.prettytable) to make it available in mechanical?
The objective is to make some external library (Ex: Tabulate) available in mechanical scripting console.
To import this external C python library, I am running the following command in the command prompt.
"C:\Program Files\ANSYS Inc\v241\commonfiles\CPython\3_10\winx64\Release\python\python.exe" -m pip install tabulate
However, now, I am trying to do the same to import an external iron python library (Ex. prettytable).
Can you please tell me the procedure to do this?
Answers
-
@AKD-Scripting-Team to the rescue! If it is possible, one of them will know how!
0 -
@Shashidhar Reddy If you have the local path of your library, you should be able to add that path to the sys.path in the mechanical scripting editor.
import sys ! already there even for ipy
sys.path.append(path2library)import library
0 -
@Shashidhar Reddy I don't think you can install external IronPython libraries as easily as for CPython. You can try downloading the source code and playing in the folder
C:\Program Files\ANSYS Inc\v242\commonfiles\IronPython\Lib
Not sure if that works but worth trying.
0