Menu

Python dynamic library integration Bug

ioncube
2023-12-03
2023-12-25
  • ioncube

    ioncube - 2023-12-03

    From the DWSIM Application Data folder in $HOME, there is a .ini for DWSIM settings. I will extract it partially here:

    [OctaveBridge]
    
    OctavePath = 
    OctaveProcessTimeout = 15
    [PythonBridge]
    
    PythonPath = 
    PythonProcessTimeout = 1
    [OSInfo]
    Platform = Linux
    Environment = 64
    

    Application fails to launch if I do either of following case. It just show splash screen & dies

    PythonPath =  /usr/lib/x86_64-linux-gnu/libpython3.10.so
    OR
    PythonPath =  /home/ukhan/Binaries/miniconda3.10/lib/libpython3.10.so
    

    Should I use lower python version, if so which?

     
    • Daniel Medeiros

      Daniel Medeiros - 2023-12-03

      can you check errors.log and see if it recorded something?

       
  • ioncube

    ioncube - 2023-12-07

    Error log

    2023-11-28 18:38:01.3782 Extender Initialization
    System.NullReferenceException: Object reference not set to an instance of an object
      at AutomaticTranslation.AutomaticTranslator.SetMainWindow (System.Windows.Forms.Form mainwindow) [0x0004c] in <dd9aae1bdf604acfa8a151e6ab29149d>:0 
      at DWSIM.FormMain.LoadExtenders () [0x00418] in <b757939e07c641f98bd9f6da26d95b13>:0 
    2023-11-28 18:39:20.0186 Extender Initialization
    System.NullReferenceException: Object reference not set to an instance of an object
      at AutomaticTranslation.AutomaticTranslator.SetMainWindow (System.Windows.Forms.Form mainwindow) [0x0004c] in <dd9aae1bdf604acfa8a151e6ab29149d>:0 
      at DWSIM.FormMain.LoadExtenders () [0x00418] in <b757939e07c641f98bd9f6da26d95b13>:0 
    2023-11-30 20:05:49.8601 FOSSEE Flowsheets loading error
    System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualBasic, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
    File name: 'Microsoft.VisualBasic, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
      at DWSIM.UI.MainForm+<>c.<InitializeComponent>b__12_11 () [0x00000] in <3e544c3da3d241d49c1fad9faed8c109>:0 
      at System.Threading.Tasks.Task`1[TResult].InnerInvoke () [0x00012] in <12b418a7818c4ca0893feeaaf67f1e7f>:0 
      at System.Threading.Tasks.Task.Execute () [0x00000] in <12b418a7818c4ca0893feeaaf67f1e7f>:0 
    2023-11-30 20:05:49.8720 FOSSEE Flowsheets loading inner exception
    System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualBasic, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
    File name: 'Microsoft.VisualBasic, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
      at DWSIM.UI.MainForm+<>c.<InitializeComponent>b__12_11 () [0x00000] in <3e544c3da3d241d49c1fad9faed8c109>:0 
      at System.Threading.Tasks.Task`1[TResult].InnerInvoke () [0x00012] in <12b418a7818c4ca0893feeaaf67f1e7f>:0 
      at System.Threading.Tasks.Task.Execute () [0x00000] in <12b418a7818c4ca0893feeaaf67f1e7f>:0 
    2023-12-02 02:14:04.5520 Extender Initialization
    System.NullReferenceException: Object reference not set to an instance of an object
      at AutomaticTranslation.AutomaticTranslator.SetMainWindow (System.Windows.Forms.Form mainwindow) [0x0004c] in <dd9aae1bdf604acfa8a151e6ab29149d>:0 
      at DWSIM.FormMain.LoadExtenders () [0x00418] in <b757939e07c641f98bd9f6da26d95b13>:0 
    2023-12-02 12:32:45.0267 Python Library Path set to /usr/lib/x86_64-linux-gnu/libpython3.10.so.1.0
    2023-12-07 10:53:10.1697 Extender Initialization
    System.NullReferenceException: Object reference not set to an instance of an object
      at AutomaticTranslation.AutomaticTranslator.SetMainWindow (System.Windows.Forms.Form mainwindow) [0x0004c] in <dd9aae1bdf604acfa8a151e6ab29149d>:0 
      at DWSIM.FormMain.LoadExtenders () [0x00418] in <b757939e07c641f98bd9f6da26d95b13>:0 
    2023-12-07 10:54:23.6588 Extender Initialization
    System.NullReferenceException: Object reference not set to an instance of an object
      at AutomaticTranslation.AutomaticTranslator.SetMainWindow (System.Windows.Forms.Form mainwindow) [0x0004c] in <dd9aae1bdf604acfa8a151e6ab29149d>:0 
      at DWSIM.FormMain.LoadExtenders () [0x00418] in <b757939e07c641f98bd9f6da26d95b13>:0 
    

    There is no error but IPython returns results ok but Python.Net doesn't run

    import math as m
    
    def ro():
        return 2*m.exp(2)
    
    
    print (ro())
    

    [12/7/2023 11:10:56 AM] 14.7781121979
    [12/7/2023 11:11:02 AM] Running script 'Script1'...
    [12/7/2023 11:11:02 AM] Error running script: No module named 'math'

     
    • Daniel Medeiros

      Daniel Medeiros - 2023-12-07

      remove the Automatic Translation files from the extenders folder, they are not needed on Linux.

       
  • ioncube

    ioncube - 2023-12-11

    Thanks for replying. But it isnt the solution to python problem. I think this integration should be more smoother in Linux platforms. However my problem is referenced before as well : https://sourceforge.net/p/dwsim/discussion/mac_newui/thread/fe96433bcb/

     
    • Daniel Medeiros

      Daniel Medeiros - 2023-12-11

      did you remove the files and it is still not working?

       
  • ioncube

    ioncube - 2023-12-14

    Dear friend please help me out. This is not working.
    This folder is now completely empty: /usr/local/lib/dwsim/extenders

     

    Last edit: ioncube 2023-12-14
  • Daniel Medeiros

    Daniel Medeiros - 2023-12-15

    are you trying to start the classic ui version on linux? it is not supported anymore

     
  • ioncube

    ioncube - 2023-12-24

    No I am trying new UI
    Further findings while searching other forums
    In the DWSIM deb there are these files available

    /usr/local/lib/dwsim$ ls -k -s | grep Python.Run
       16 Python.Runtime.deps.json
      396 Python.Runtime.dll
        4 Python.Runtime.dll.config
      180 Python.Runtime.pdb
    

    But these file also available when you install pythonnet via pip

    ~/Binaries/miniconda3.10/lib/python3.10/site-packages/pythonnet/runtime$ ls -k -s | grep Python.Run
     12 Python.Runtime.deps.json
    424 Python.Runtime.dll
    192 Python.Runtime.pdb
    184 Python.Runtime.xml
    

    The files have different sizes to what is packaged by default?
    Additionally the contents of Python.Runtime.dll.config indicate that these dlls were made using Py v3.7

     
    • Daniel Medeiros

      Daniel Medeiros - 2023-12-25

      what happens if you remove the ones in dwsim's directory?

       

Log in to post a comment.