Hello,
I have written an add-on program for Plaxis for designing retaining walls. The program works OK and now I want to convert it to a ".exe" file to distribute it in the company.
I'm converting my Plaxis code to ".exe" using the simple PyInstaller procedure described in here: "https://kivy.org/doc/stable/guide/packaging-windows.html"
However, this procedure does not work for me and I realized that the reason is I'm importing Plaxis libraries in my Python code:
from plxscripting.easy import *import plxscripting.easyAs soon as I delete these two lines, the procedure works and my .exe file runs okay (obviously wont run a Plaxis code as I have deleted Plaxis libraries).So I wanna know what I need to do to fix this issue. Potentially I need to import something from Plaxis libraries to the ".spec" file? (maybe I'm wrong)Thank you very much
Hello Farbod,
In general, when it comes to PLAXIS we are always willing to assist, but when it comes to Python programming, it goes beyond our support services.
However, you can reach out and I can try to point you in the right directions, which for me are:
- which distribution do you run the converter from (the one PLAXIS provides or a custom one)
- are the required modules present in either distribution
Hi Stefanos,
It seems like I am unable to solve my problem and convert my program to exe. Is this something that I can do service request for?
Thanks a lot again.
The module to create an executable does not really matter. What is important is that the available modules should exist in whichever Python version is considered by Windows as default.
You can find online articles that explain which Python version will run when you double-click on a Python file on your PC.
Another thing to consider is the boilerplate you use. By creating an executable you need to include the boilerplate to run it. Given that the required modules are present in your Python distribution, you need to consider that the boilerplate includes a password and a port that are probably hard-coded.
So, you need to consider adding a user input (as variables) so that your script will not rely on that and can be shared with anyone. That means that the first step would be to either have the user launch PLAXIS, configure the remote scripting server, or have the script do that.
Thanks Stefanos,
The program I wrote also include GUI and embedded images etc. Thats why I need to make a ".exe" version that people can install on their computers rather than sending them the whole package manually.
Have you ever converted any Plaxis Python code to exe? if so, what module did you use that worked?
I should also mention that all the required modules are included in the python code and it works fine. I just cant convert it to exe.
Cheers
Dear Farbod,
In general, PLAXIS supports opening a Python tool via the Expert menu. Therefore you can easily distribute this Python script as we do for all our Python tools.
You can watch a video about it here: https://youtu.be/IRKUNFDsUxU?list=PLi6GGAwNWJlC_szRmgfkjrjlqjEqDmEc0&t=221
This is part of the series about Getting Started with PLAXIS Automation: https://www.youtube.com/playlist?list=PLi6GGAwNWJlC_szRmgfkjrjlqjEqDmEc0
In order to convert the script to an executable I would check all the details of the module you want to use. I have not really used PyInstaller but I am assuming there is some configuration that may be required.
It may be that the executable tries to run by using a local Python distribution and not the PLAXIS Python Distribution we deliver, and therefore the necessary modules are missing. It would be good to do some debugging on your code to understand what the error is.
With regards to the modules used, PLAXIS requires the following modules to be available in all cases in a local environment: