Module Connector - MacOS 1.6.2

SW used to communicate with all XeThru modules on a host computer

  1. Michael Romeo

    Michael Romeo New Member

    Hello,
    I'm having trouble running this code in Xcode on MacOS. I've properly linked all header files but even though I've linked correct path for the dylib and done copy paths, linked frame work and libraries I still get the following error on compilation

    dyld: Library not loaded: libModuleConnector.dylib
    Reason: image not found
     
  2. Charlie Shao

    Charlie Shao Moderator Staff Member

    Hi Micheal,
    Which examples are you working on? Python or CPP?
     
  3. Michael Romeo

    Michael Romeo New Member

    I'm looking at the CPP project
     

    Attached Files:

  4. Christian Rødli Amble

    Christian Rødli Amble Member Staff Member

    Christian Rødli Amble updated Module Connector - MacOS with a new update entry:

    ModuleConnector v 1.5.3

    Read the rest of this update entry...
     
  5. exile1

    exile1 New Member

    Hi,
    I'm trying to run the python module connector on mac (using the package in ModuleConnector-osx-1.5.3.zip). I get the same error that Stylianos reports in an above post when I try to run any of the examples included as well as shorter tests that try to include the moduleconnector:
    Code:
    from pymoduleconnector import ModuleConnector
      File "/Documents/new_workspace/Hello/ModuleConnector-osx-1.5.3/python36-x86_64-apple-darwin/pymoduleconnector/__init__.py", line 2, in <module>
        from .moduleconnector import DataReader
      File "/Documents/new_workspace/Hello/ModuleConnector-osx-1.5.3/python36-x86_64-apple-darwin/pymoduleconnector/moduleconnector.py", line 5, in <module>
        from .moduleconnectorwrapper import \
      File "/Documents/new_workspace/Hello/ModuleConnector-osx-1.5.3/python36-x86_64-apple-darwin/pymoduleconnector/moduleconnectorwrapper/__init__.py", line 7, in <module>
        from . import _moduleconnectorwrapper
    ImportError: dlopen(/Documents/new_workspace/Hello/ModuleConnector-osx-1.5.3/python36-x86_64-apple-darwin/pymoduleconnector/moduleconnectorwrapper/_moduleconnectorwrapper.so, 2): Library not loaded: /usr/local/opt/python3/Frameworks/Python.framework/Versions/3.6/Python
      Referenced from: /Documents/new_workspace/Hello/ModuleConnector-osx-1.5.3/python36-x86_64-apple-darwin/pymoduleconnector/moduleconnectorwrapper/_moduleconnectorwrapper.so
      Reason: image not found
    
    I installed python directly (not Anaconda or Miniconda), and a `which python` gives me:
    `python --version` gives me:
    When I ran `python setup.py install` everything seemed to run correctly without any errors or warnings that I could find.

    I can get other test python code to run correctly without a problem. Does anyone have any thoughts on this? I'm relatively new to python, so it's possible the answer is obvious but I'm missing it...Thank you!
     
    Last edited: Sep 26, 2018
  6. Charlie Shao

    Charlie Shao Moderator Staff Member

    Could you try Sigurd's solution: https://www.xethru.com/community/threads/module-connector-macos.134/#post-1452
    install python3 using ie. homebrew
    $ brew install python3
    Install python to the system folder /usr/local/bin and run `python setup.py install` again, then run examples.
     
  7. exile1

    exile1 New Member

    Hi Charlie,
    Thanks for the reply. I actually did follow Sigurd's solution previously (uninstalled miniconda, reinstalled python3 via homebrew) and python was installed in /usr/local/bin, ran setup, but ended up with the same error I quoted above when I tried to run any test scripts using moduleexplorer.

    One thing I realized at the time was that '$ brew install python3' had installed python 3.7 and, based on the error message, it appeared that the xethru scripts were specifically looking for 3.6 (I might be mistaken in that assumption...). I used these commands to install 3.6 specifically (from https://stackoverflow.com/questions/51726203/installing-python3-6-alongside-python3-7-on-mac):
    I used '$ brew switch python 3.6.5_1' to switch to the python 3.6 and the system showed it was indeed using 3.6. After this, I continued to get the error I quoted in my original post.

    Someone more expert in python than myself walked me through setting up the virtual environments the way they are set up now (which is why the 'which python' command gives me the .virtualenvs path now).

    Any other thoughts on a possible solution? Thanks again!
     
    Last edited: Sep 27, 2018
  8. Sigurd Pleym

    Sigurd Pleym New Member Staff Member

    Hmm, I haven't upgraded yet so I have not encountered this problem. I will try do so soon. I don't think our scripts look for 3.6, the question would rather be which python3 version was linked to after you upgrade
    For instance:
    > python3 --version
    or
    > /usr/local/bin/python3 --version
    if you an Anaconda installation as well

    I will specifically look for this problem after next python upgrade and give you an update then.
     
  9. exile1

    exile1 New Member

    Thanks for the reply,
    So I get the same error whether I have 3.7 or 3.6.x running. I manually installed 3.6 because of the error message, but in the end that didn't help. To be clear on the current state of my system:
    - I do NOT have Anaconda on my system
    - I have Python 3.7, 3.6.5, and 2.7 available
    - 'which python' returns /usr/local/bin/python
    - 'which python3' returns /usr/local/bin/python3
    - 'python3 --version' returns Python 3.6.5 (I can set it to use Python 3.7, but no resolution to my issue on either python3 version)
     
  10. Christian Rødli Amble

    Christian Rødli Amble Member Staff Member

    Christian Rødli Amble updated Module Connector - MacOS with a new update entry:

    ModuleConnector v 1.6.2

    Read the rest of this update entry...