How to install the Granta STK in IronPython in Ansys?

Sjoerd Tilmans
Sjoerd Tilmans Member, Employee Posts: 4
First Anniversary Ansys Employee Photogenic
✭✭✭
edited June 2023 in Materials

There doesn't seem to be a way to just "pip install" something in IronPython. Is there a good way of installing packages, such as the Granta STK, in IronPython?

Tagged:

Answers

  • Doug Addy
    Doug Addy Member, Moderator, Employee Posts: 22
    Second Anniversary 5 Answers 10 Comments Name Dropper
    ✭✭✭✭
    Answer ✓

    As an answer to the general question, most packages are available through easy_install.exe. This should be present in a plain installation of IronPython in the Scripts folder.

    I had various issues with installing packages, the most common one was

    TypeError: argument of type 'ZipFile' is not iterable

    This is easily fixed by retrying the installation, which should succeed the second (or occasionally third) time.

    I also had problems with dependency installation, in these cases I had to manually install the dependencies using easy_install (in my case this was traitlets, simplegeneric and scandir).

    The documentation for IronPython claims that pip now works, as long as you invoke it like:

    ./ipy.exe -X:FullFrames -m pip install my_package
    

    I was able to get it to download packages correctly, but they were not available for me in the interpreter. The only way I was able to use packages was with easy_install as above.