Python interpreter

Hi,

I've been writing python scripts for the PLAXIS using the Scite notebook, but would like to start using an interpreter such as Sypder to work in instead. I know there is the Jupyter interpreter installed with PLAXIS, but I don't find this as useful as Spyder. Is there any guidance available on configuring a different python interpreter? I've tried using the configure python interpreter option however I get an error that it's not been possible to install a number of packages?

Kind regards

Maddie

Parents Reply Children
  • Hi Stefanos, 

    Thanks very much for the reply, i'm a bit delayed in giving it a go because of a job change, but i've just tried following those examples and having some trouble still. 

    On Spyder i've gone to Preferences -> Python interpreter -> selected use the following python interpreter and then pointed Spyder to the python.exe (C:/ProgramData/Bentley/Geotechnical/PLAXIS Python Internal Distribution V2/python_internal/python.exe)

    But i'm not really sure where to go from there, Spyder still doesn't seem to be able to communicate with PLAXIS. I get an error that a module isn't installed, and when i try pip installing as it suggests get an error that pip isn't recognised!

    I've also tried to open an interpreter through PLAXIS doesn't do anything (i've tried pointing it to the python.exe in the location of Spyder, but I get some errors and no interpreter opens up when I try that, see clip below). 

    Apologies that these are more python queries than PLAXIS, or if I'm just not understanding some basic! Any help would be really appreciated!

    Kind regards

    Maddie

  • Dear Maggie,

    No problem, I can help you with that. (Congrats on the new job!)

    The first issue is related to Spyder. I have seen before that some specific Spyder versions do not work well with our Python distribution (with additional modules).
    Please try to search and download the version that is shipped with Python 3.8.10 to see if that helps (it has helped others, too).

    Other than that, I am not sure what else to suggest as this points to spyder kernels, so it is not on the PLAXIS side. 
    Personally, I use PyCharm.

    On the second issue you show, probably you did not have the proper rights to perform this action. In the article provided before, it is stated:
    Note that it is important in all cases to provide administrative rights to the application in order to allow for installing Python modules in the selected Python environment.

    You can start PLAXIS as an administrator from the Windows Start menu and then the operation should work.

  • Hi Stefanos, 

    Thanks for the quick reply,

    Can confirm my spyder is working with 3.8.10, 

    A fair amount of googling later I found an article that solved the kernels issue for me (for pointing Spyder to PLAXIS), i've seen others having the same issue so link below, I followed section Working with other environments and Python installations

    https://github.com/spyder-ide/spyder/wiki/Working-with-packages-and-environments-in-Spyder

    Doing it the other way round (configuring plaxis interpreter to Spyder) still didn't work even after i'd used admin rights and made sure i manually copied the libraries plaxis needed into my Spyder environment. I didn't get an error when I tried to open the interpreter, just nothing happened. 

    Thanks for your help!

    Maddie

  • Hello Maddie,

    Great to hear that you got it working.

    Not sure exactly what is happening in the Spyder distro with Interpreter in PLAXIS, but typically it has to do with conflicts or lack of modules. But since you got everything working with Spyder, I assume you want to use that application instead.