<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://communities.bentley.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Running Plaxis from Pycharm</title><link>https://communities.bentley.com/products/geotech-analysis/f/forum/234404/running-plaxis-from-pycharm</link><description>Hi, 
 
 Im trying to run my plaxis python code using Pycharm and as soon as the code reaches &amp;quot; import plxscripting.easy&amp;quot;, Ill get ImportError: 
 &amp;quot;ImportError: cannot import name &amp;#39;MutableMapping&amp;#39; from &amp;#39;collections&amp;#39; (C:\Users\Farbod\AppData\Local\Programs</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Running Plaxis from Pycharm</title><link>https://communities.bentley.com/thread/728717?ContentTypeID=1</link><pubDate>Sun, 28 Aug 2022 23:12:21 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:e9bf06ec-0616-48ea-bbff-04d925277e7e</guid><dc:creator>Farbod Yarmohammadi</dc:creator><description>&lt;p&gt;Genius! Thanks Stefanos.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Just in case anybody wants to use this in the future, in the code above I think &amp;quot;--Password =&amp;nbsp;&lt;em&gt;YourPassword&amp;quot; should be changed to:&lt;/em&gt;&lt;/p&gt;
&lt;pre&gt;&lt;span&gt;&amp;quot;--AppServerPassword=YourPassword&amp;quot;.&lt;br /&gt;&lt;br /&gt;Thanks again,&lt;br /&gt;Farbod&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;em&gt;&amp;nbsp;&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Running Plaxis from Pycharm</title><link>https://communities.bentley.com/thread/728303?ContentTypeID=1</link><pubDate>Thu, 25 Aug 2022 08:35:26 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:b00e2127-0b4d-480b-8b46-3657789fbc3a</guid><dc:creator>Stefanos Papavasileiou</dc:creator><description>&lt;p&gt;Dear Farbod,&lt;/p&gt;
&lt;p&gt;Indeed, if PLAXIS is not running you cannot just try to start a &lt;em&gt;new_server&lt;/em&gt;. The generic workflow would be to have PLAXIS running first, activating the server with a port and a password and then running your script.&lt;/p&gt;
&lt;p&gt;If you want to skip this part, then as with any Windows application, Python can launch it using a different module. For instance:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;import subprocess&lt;/em&gt;&lt;br /&gt;&lt;em&gt;subprocess.Popen([r"C:\Program Files\Bentley\Geotechnical\PLAXIS 2D CONNECT Edition V22\Plaxis2DXInput.exe", "--AppServerPort=10000", "--AppServerPassword=YourPassword"])&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt; from plxscripting.easy import *&lt;/em&gt;&lt;br /&gt;&lt;em&gt; s_i, g_i = new_server(&amp;#39;localhost&amp;#39;, 10000, password=&amp;#39;YourPassword&amp;#39;)&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;# add your code here&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Running Plaxis from Pycharm</title><link>https://communities.bentley.com/thread/728173?ContentTypeID=1</link><pubDate>Wed, 24 Aug 2022 22:49:51 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:a1665c7c-f05d-4ef0-bb7c-447cbad9f543</guid><dc:creator>Farbod Yarmohammadi</dc:creator><description>&lt;p&gt;Thank you for the reply Stefanos. I really appreciate your help.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;But as I mentioned in my previous comment, when I use this code:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;pre&gt;&lt;span&gt;from &lt;/span&gt;plxscripting.easy &lt;span&gt;import &lt;/span&gt;*&lt;br /&gt;&lt;br /&gt;localhostport_input = &lt;span&gt;10000&lt;br /&gt;&lt;/span&gt;localhostport_output = &lt;span&gt;10001&lt;br /&gt;&lt;/span&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;s_i, g_i = &lt;span&gt;new_server&lt;/span&gt;(&lt;span&gt;&amp;#39;localhost&amp;#39;&lt;/span&gt;, &lt;span&gt;10000&lt;/span&gt;, &lt;span&gt;password&lt;/span&gt;=&lt;span&gt;&amp;#39;YourPassword&amp;#39;&lt;/span&gt;)&lt;br /&gt;s_o, g_o = &lt;span&gt;new_server&lt;/span&gt;(&lt;span&gt;&amp;#39;localhost&amp;#39;&lt;/span&gt;, localhostport_output, &lt;span&gt;password&lt;/span&gt;=&lt;span&gt;&amp;#39;YourPassword&amp;#39;&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;It leads to the following error:&lt;br /&gt;plxscripting.requests.exceptions.ConnectionError: HTTPConnectionPool(host=&amp;#39;192.168.12.12&amp;#39;, port=10000): Max retries exceeded with url: /environment (Caused by &amp;lt;class &amp;#39;TimeoutError&amp;#39;&amp;gt;: &lt;br /&gt;[WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The only way I can get it to work, is to &lt;span style="text-decoration:underline;"&gt;manually&lt;/span&gt; start the server with the &lt;span style="text-decoration:underline;"&gt;same password&lt;/span&gt; and same port from &lt;br /&gt;Plaxis and then run this code. &lt;br /&gt;&lt;br /&gt;Is there any way to run this code without having to manually starting the server from Plaxis?&lt;br /&gt;&lt;br /&gt;Thank you very much again,&lt;br /&gt;&lt;br /&gt;Farbod&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Running Plaxis from Pycharm</title><link>https://communities.bentley.com/thread/728012?ContentTypeID=1</link><pubDate>Wed, 24 Aug 2022 07:34:32 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:83179c4a-efa8-4800-a545-babbd8a63259</guid><dc:creator>Stefanos Papavasileiou</dc:creator><description>&lt;p&gt;Dear Farbod,&lt;/p&gt;
&lt;p&gt;Great that it helped!&lt;/p&gt;
&lt;p&gt;Indeed you are missing the password parameter in the new_server function.&lt;/p&gt;
&lt;p&gt;The boilerplate is:&lt;/p&gt;
&lt;pre&gt;&lt;span&gt;from&lt;/span&gt; plxscripting.easy &lt;span&gt;import&lt;/span&gt; &lt;span&gt;*&lt;/span&gt;
s_i, g_i &lt;span&gt;=&lt;/span&gt; new_server(&lt;span&gt;&amp;#39;localhost&amp;#39;&lt;/span&gt;, 10000, password&lt;span&gt;=&lt;/span&gt;&lt;span&gt;&amp;#39;yourpassword&amp;#39;&lt;/span&gt;)&lt;/pre&gt;
&lt;p&gt;You can find this here:&amp;nbsp;&lt;a href="https://communities.bentley.com/products/geotech-analysis/w/plaxis-soilvision-wiki/46005/using-plaxis-remote-scripting-with-the-python-wrapper"&gt;communities.bentley.com/.../using-plaxis-remote-scripting-with-the-python-wrapper&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Running Plaxis from Pycharm</title><link>https://communities.bentley.com/thread/727986?ContentTypeID=1</link><pubDate>Wed, 24 Aug 2022 03:33:23 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:a27dc71b-1cce-4e90-b004-f55d565e4007</guid><dc:creator>Farbod Yarmohammadi</dc:creator><description>&lt;p&gt;Hi Stefanos,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Amazing. That solved that issue. But now when I wanna run my code in PyCharm, I get the following error:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Exception: Couldn&amp;#39;t get AppServerPassword from command line arguments.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This is the boilerplate Im using in my code:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;pre&gt;&lt;span&gt;from &lt;/span&gt;plxscripting.easy &lt;span&gt;import &lt;/span&gt;*&lt;br /&gt;&lt;span&gt;import &lt;/span&gt;plxscripting.easy&lt;br /&gt;&lt;span&gt;import &lt;/span&gt;math&lt;br /&gt;&lt;span&gt;import &lt;/span&gt;weakref&lt;br /&gt;&lt;span&gt;import &lt;/span&gt;win32api&lt;br /&gt;&lt;br /&gt;localhostport_input = &lt;span&gt;10000&lt;br /&gt;&lt;/span&gt;localhostport_output = &lt;span&gt;10001&lt;br /&gt;&lt;/span&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;s_i, g_i = &lt;span&gt;new_server&lt;/span&gt;(&lt;span&gt;&amp;#39;localhost&amp;#39;&lt;/span&gt;, localhostport_input)&lt;br /&gt;s_o, g_o = &lt;span&gt;new_server&lt;/span&gt;(&lt;span&gt;&amp;#39;localhost&amp;#39;&lt;/span&gt;, localhostport_output)&lt;br /&gt;&lt;br /&gt;If I delete the last two lines, I will get the error &amp;quot;s_i not recognized&amp;quot;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Also, if I change the last two lines to these:&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;
&lt;pre&gt;s_i, g_i = &lt;span&gt;new_server&lt;/span&gt;(&lt;span&gt;&amp;#39;localhost&amp;#39;&lt;/span&gt;, localhostport_input, &lt;span&gt;password &lt;/span&gt;= &lt;span&gt;&amp;#39;password&amp;#39;&lt;/span&gt;)&lt;br /&gt;s_o, g_o = &lt;span&gt;new_server&lt;/span&gt;(&lt;span&gt;&amp;#39;localhost&amp;#39;&lt;/span&gt;, localhostport_output, &lt;span&gt;password &lt;/span&gt;= &lt;span&gt;&amp;#39;password&amp;#39;&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;I will get the error below when I execute the s_i.new() command:&lt;br /&gt;&lt;br /&gt;plxscripting.plx_scripting_exceptions.PlxScriptingError: The server failed to decrypt the request. This probably means the password on the client does not match the one on the server.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Is there any other boilerplate code I should use?&lt;br /&gt;&lt;br /&gt;Thank you very much again,&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Running Plaxis from Pycharm</title><link>https://communities.bentley.com/thread/727843?ContentTypeID=1</link><pubDate>Tue, 23 Aug 2022 10:43:14 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:9018cecf-99b1-456a-b9f9-36747e6f6a3f</guid><dc:creator>Stefanos Papavasileiou</dc:creator><description>&lt;p&gt;Dear Farbod,&lt;/p&gt;
&lt;p&gt;Indeed the error means that you do not have installed the module PLAXIS uses. You can do that with the information from this article:&amp;nbsp;&lt;br /&gt;&lt;a href="/products/geotech-analysis/w/plaxis-soilvision-wiki/51822/how-to-install-additional-python-modules-in-plaxis"&gt;https://communities.bentley.com/products/geotech-analysis/w/plaxis-soilvision-wiki/51822/how-to-install-additional-python-modules-in-plaxis&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I am also using PyCharm and I am pointing it to the PLAXIS Python Distribution we deliver. However, you need to make sure you pick the right one for the PLAXIS&amp;nbsp;version you are using.&lt;/p&gt;
&lt;p&gt;You can find them in this folder:&amp;nbsp;&lt;em&gt;C:\ProgramData\Bentley\Geotechnical&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Make sure to pick the one that says:&amp;nbsp;&lt;strong&gt;PLAXIS Python Distribution&lt;/strong&gt; (not the&amp;nbsp;PLAXIS Python &lt;em&gt;Internal&lt;/em&gt; Distribution).&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s how it looks in my case, where I have picked the V22 and V21 Python distributions and a local one:&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/343671/pastedimage1661251225014v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>