Skip to content
0
  • Recent
  • Tags
  • Popular
  • SAMSON Connect
  • Get SAMSON
  • Recent
  • Tags
  • Popular
  • SAMSON Connect
  • Get SAMSON
Collapse
SAMSON Forum
  1. Home
  2. Develop
  3. Modeling
  4. Python bindings for my custom model

Python bindings for my custom model

Scheduled Pinned Locked Moved Modeling
58 Posts 2 Posters 89.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • DmitriyMarinD
    DmitriyMarinD
    DmitriyMarin
    wrote on last edited by DmitriyMarin
    #12

    Dear @Elisa

    Thank you for reporting it! I will add the tested installations to the installation tutorial.

    I have not tested Python Scripting with python 3.7. I do not expect it to work with python 3.7 since it was compiled against python 3.6 and is linked to python3.6 library.
    The loaded python scripting means that you probably have a proper version of python library. The fact that Jupyter QtConsole is not loaded might mean that its version is not the one against which it was compiled.

    What OS do you use?

    I am using Python Scripting in Linux with Python 3.6.4 and Jupyter QtConsole 4.3.1 from Anaconda 5.1 installation. Anaconda 5.2 installation might also be fine (tested only on Windows).

    Dmitriy,
    The SAMSON Team, https://s-c.io

    1 Reply Last reply
    0
    • DmitriyMarinD
      DmitriyMarinD
      DmitriyMarin
      wrote on last edited by
      #13

      I have added a list of tested installation: https://documentation.samson-connect.net/scripting-guide/python-script-installation/

      Dmitriy,
      The SAMSON Team, https://s-c.io

      1 Reply Last reply
      0
      • DmitriyMarinD
        DmitriyMarinD
        DmitriyMarin
        wrote on last edited by
        #14

        @Elisa

        Is it possible for you to try to downgrade Jupyter QtConsole to v.4.3.1 and check?

        Dmitriy,
        The SAMSON Team, https://s-c.io

        1 Reply Last reply
        0
        • E
          E
          Elisa
          wrote on last edited by
          #15

          Hi, I'm using Anaconda 5.3.1 I just downgraded to QtConsole 4.3.1 and python from 3.6.7 to 3.6.5, but I still don't get the jupyter qtconsole on Python Scripting module. The versions I'm using for the rest of dependencies are:
          jupyter 1.0.0
          jupyter_client 5.2.3
          jupyter_console 6.0.0
          jupyter_core 4.4.0
          numpy 1.15.4

          I will try downloading Anaconda 5.2 and reinstalling from there.

          1 Reply Last reply
          1
          • DmitriyMarinD
            DmitriyMarinD
            DmitriyMarin
            wrote on last edited by
            #16

            Sorry for this issue!
            It is really due to linking to particular versions of libraries we do in Python Scripting.

            I will try to reproduce your case and come up with a full list of dependencies and proper versions for required packages.
            In my Anaconda installation on Linux these packages have the following version:

            jupyter                   1.0.0
            jupyter_client            5.2.2
            jupyter_console           5.2.0
            jupyter_core              4.4.0
            numpy                     1.14
            

            On Windows:

            jupyter                   1.0.0
            jupyter_client            5.2.3
            jupyter_console           5.2.0
            jupyter_core              4.4.0
            numpy                     1.14.3
            

            Could you, please, try downgrading numpy to v.1.14?

            If it won't work, it would be nice if you will be able to try the Anaconda3 installation written in the Tested installations section in the documentation.

            Dmitriy,
            The SAMSON Team, https://s-c.io

            1 Reply Last reply
            0
            • E
              E
              Elisa
              wrote on last edited by
              #17

              I have run conda install anaconda=5.2, now all the packages match the versions you have, but I still am unable to see the the jupyter qtconsole on the Python Scripting module. Maybe the error is somewhere else, is there a log a could check?

              1 Reply Last reply
              0
              • DmitriyMarinD
                DmitriyMarinD
                DmitriyMarin
                wrote on last edited by
                #18

                What OS do you use?
                Could you, please, check the environment variables for which Python paths are set there?

                Dmitriy,
                The SAMSON Team, https://s-c.io

                1 Reply Last reply
                0
                • E
                  E
                  Elisa
                  wrote on last edited by
                  #19

                  Yes, I'm using Windows 10, and the Path variables for anaconda3 are set (I added them when installing). I will try to install Anaconda3 for all users, in case the problem comes from this.

                  1 Reply Last reply
                  0
                  • DmitriyMarinD
                    DmitriyMarinD
                    DmitriyMarin
                    wrote on last edited by
                    #20

                    It should not be a problem, it should work for a user installation. On my Windows 10 I have it installed only for my user.

                    Dmitriy,
                    The SAMSON Team, https://s-c.io

                    1 Reply Last reply
                    0
                    • DmitriyMarinD
                      DmitriyMarinD
                      DmitriyMarin
                      wrote on last edited by
                      #21

                      To see the SAMSON log on Windows, you can open a terminal (Power Shell) and launch SAMSON from there (provide the full path to the SAMSON executable or launch from where it is installed):

                      .\SAMSON-Core.exe --logfile="samson.log"
                      

                      Then you can open the log file and search for the line: "Python Scripting: initialization ..."
                      Could you, please, post here what you have in this log after this line (related to the Python Scripting).

                      Dmitriy,
                      The SAMSON Team, https://s-c.io

                      1 Reply Last reply
                      1
                      • DmitriyMarinD
                        DmitriyMarinD
                        DmitriyMarin
                        wrote on last edited by
                        #22

                        By the way, which version of Anaconda3 you installed now, the 64-bit one? Anaconda3-5.2.0-Windows-x86_64.exe (see https://repo.anaconda.com/archive/)?

                        Dmitriy,
                        The SAMSON Team, https://s-c.io

                        1 Reply Last reply
                        0
                        • E
                          E
                          Elisa
                          wrote on last edited by
                          #23

                          Yes, I installed the 64bit.

                          I think the problem is that I might not have set the appropriate paths. If I execute jupyter qtconsole from within anaconda, it runs fine. But if I try to execute it from the command line, it throws an error saying it can't find PyQt5. I also realized that they added the folder Library/usr/bin to the PATH variable, but in my anaconda installation there is no such folder. I think maybe I'm missing a path.

                          DmitriyMarinD 1 Reply Last reply
                          0
                          • E
                            E
                            Elisa
                            wrote on last edited by Elisa
                            #24

                            Sorry, I just saw the logging option! I went back to a clean installation of Anaconda3 with python 3.7 to see if I could load by default the jupyter qtconsole from cmd. So now the error is:

                            ===================================================================
                            "7B654CE6-E38C-B97F-6746-4FD6934487C2.dll"  Errors
                            -------------------------------------------------------------------
                            >  "Cannot load library"
                                   "Sorry I cannot help you"
                            ===================================================================
                            ===================================================================
                            7B654CE6-E38C-B97F-6746-4FD6934487C2.dll Errors
                            ------------------------------------------------------------------
                            > Cannot load library
                                  Sorry I cannot help you
                            
                            DmitriyMarinD 1 Reply Last reply
                            0
                            • E Elisa

                              Sorry, I just saw the logging option! I went back to a clean installation of Anaconda3 with python 3.7 to see if I could load by default the jupyter qtconsole from cmd. So now the error is:

                              ===================================================================
                              "7B654CE6-E38C-B97F-6746-4FD6934487C2.dll"  Errors
                              -------------------------------------------------------------------
                              >  "Cannot load library"
                                     "Sorry I cannot help you"
                              ===================================================================
                              ===================================================================
                              7B654CE6-E38C-B97F-6746-4FD6934487C2.dll Errors
                              ------------------------------------------------------------------
                              > Cannot load library
                                    Sorry I cannot help you
                              
                              DmitriyMarinD
                              DmitriyMarinD
                              DmitriyMarin
                              wrote on last edited by
                              #25

                              @Elisa
                              This error means that it was not possible to load the module, in the case of the Python Scripting Element it is probably due to the wrong python library version (since Python Scripting is compiled and linked against python3.6 library).

                              Dmitriy,
                              The SAMSON Team, https://s-c.io

                              1 Reply Last reply
                              0
                              • E Elisa

                                Yes, I installed the 64bit.

                                I think the problem is that I might not have set the appropriate paths. If I execute jupyter qtconsole from within anaconda, it runs fine. But if I try to execute it from the command line, it throws an error saying it can't find PyQt5. I also realized that they added the folder Library/usr/bin to the PATH variable, but in my anaconda installation there is no such folder. I think maybe I'm missing a path.

                                DmitriyMarinD
                                DmitriyMarinD
                                DmitriyMarin
                                wrote on last edited by DmitriyMarin
                                #26

                                @Elisa

                                If you have installed Anaconda3 you have PyQt5 installed. Apparently, the error when you launch Jupyter QtConsole from the command line and it cannot find PyQt5 is due to a conflict with your Qt installation (e.g. Qt 5.9.3) either because of the order in the PATH environment variable or, if you were changing versions of packages in your anaconda installation, because of the not suitable version of PyQt5 for jupyter qtconsole (but then it would not allow launching it from within the anaconda).

                                Could you, please, check the PATH environment variables (the system one and the user one).

                                Dmitriy,
                                The SAMSON Team, https://s-c.io

                                1 Reply Last reply
                                0
                                • DmitriyMarinD
                                  DmitriyMarinD
                                  DmitriyMarin
                                  wrote on last edited by
                                  #27

                                  This is how the user Path environment variable looks like for my installation on Win10:

                                  0_1544117611766_PathUserEnvVar.png

                                  Dmitriy,
                                  The SAMSON Team, https://s-c.io

                                  1 Reply Last reply
                                  0
                                  • E
                                    E
                                    Elisa
                                    wrote on last edited by
                                    #28

                                    I checked the path environment, but it looks like yours, I also have there Qt\5.8\msvc2015_64\bin and Qt\5.8\msvc2015_64\lib (makes no difference if I add them or remove them). I must have broken the Python installation at some point, I also think the problem is on my side, probably regarding the paths. I will keep looking!

                                    1 Reply Last reply
                                    0
                                    • DmitriyMarinD
                                      DmitriyMarinD
                                      DmitriyMarin
                                      wrote on last edited by
                                      #29

                                      Sorry again for the issue!
                                      The Python Scripting Element is quite dependent on particular version of python and might be on versions of some packages (e.g., jupyter qtconsole) as well.

                                      If you think that it is due to your broken Anaconda3 installation, I would advice you to uninstall all the anaconda installations (check the Path environment variables as well), restart your PC and install the Anaconda3-5.2.0-Windows-x86_64.exe (https://repo.anaconda.com/archive/Anaconda3-5.2.0-Windows-x86_64.exe).

                                      Dmitriy,
                                      The SAMSON Team, https://s-c.io

                                      1 Reply Last reply
                                      0
                                      • E
                                        E
                                        Elisa
                                        wrote on last edited by
                                        #30

                                        With the Anaconda3-5.2 installer it worked! I don't know if maybe downgrading from 5.3 broke some dependencies or some packages where not downgraded to the same versions, or if there were traces of the previous versions somehow, but now it works.

                                        Thanks for your help and best regards,

                                        Elisa

                                        1 Reply Last reply
                                        1
                                        • DmitriyMarinD
                                          DmitriyMarinD
                                          DmitriyMarin
                                          wrote on last edited by
                                          #31

                                          Great! Sorry again for the issue and all the installations and reinstallations you had to do.

                                          We had the same problem after upgrading from an older version of Python to Python 3.6 via Anaconda3. And the clean installation helped.

                                          Dmitriy,
                                          The SAMSON Team, https://s-c.io

                                          1 Reply Last reply
                                          1

                                          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                          With your input, this post could be even better 💗

                                          Register Login
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post