Hi everybody. I am trying to run this code and I got the error that shows No module named 'plxscripting'. could you help me.
#Connect with PLAXISOutputlocalhostport_input = 10000 from plxscripting.easy import * s_og_o = new_server('localhost', localhostport_output, password='**************')plaxis_path = r'C:\Program Files\Bentley\Geotechnical\PLAXIS 2D CONNECT Edition V21\Plaxis2DOutput.exe'
import impfound_module = imp.find_module('plxscripting', [plaxis path])plxscripting = imp.load_module('plxscripting', *found_module)from plxscripting.easy import *
s_o,g_o = new_server('localhost', localhostport_output)
Dear Hamed,
I noticed that in your code you are using the imp module which is deprecated in Python.
Also, we have a new boilerplate to use for PLAXIS nowadays and the information can be found here, too:https://communities.bentley.com/products/geotech-analysis/w/plaxis-soilvision-wiki/46005/using-plaxis-remote-scripting-with-the-python-wrapper
In short:
from plxscripting.easy import * s_o, g_o = new_server('localhost', 10000, password='yourpassword')
Note that the Python installations are nowadays (since V20.01) stored in the ProgramData folder as it is shared between all PLAXIS software:C:\ProgramData\Bentley\Geotechnical
Thank you for your reply. I modified the imp module as the linked mentioned.
#Connect with PLAXISOutputlocalhostport_input = 10000 localhostport_output = 10001from plxscripting.easy import *s_i, g_i = new_server('localhost', localhostport_input, password='r************N') s_o, g_o = new_server('localhost', localhostport_output, password='r*************N')plaxis_path = r'C:\Program Files\Bentley\Geotechnical\PLAXIS 2D CONNECT Edition V21\Plaxis2DOutput.exe'
but still I have the same error. I found ProgramData on my laptop and even I reached the address of C:\ProgramData\Bentley\Geotechnical\PLAXIS Python Internal Distribution V1 Update 1\python_internal\Lib\site-packages\plxscripting then tried to use the command prompt using pip install commend to install the module manually but it did not work. If have any more advice please let me know.
Is this error in the SciTE or in another IDE(PyCharm, spyder, etc.)?