transplant icon indicating copy to clipboard operation
transplant copied to clipboard

Opening libzmq on mac

Open tombadmanship opened this issue 7 years ago • 13 comments

Hello, I am trying to use transplant to open a python app that uses matlab runtime 2017a. i have editted the search paths for libzmq to include the locations where libzmq is installed on my computer. These are my edits:

575 search_dirs = ((os.getenv('LD_LIBRARY_PATH') or '').split(':') + 576 (os.getenv('DYLD_LIBRARY_PATH') or '').split(':') + 577 (os.getenv('DYLD_FALLBACK_PATH') or '').split(':') + 578 [os.getenv('HOME') + '/lib']+ 579 '/usr/local/lib'+ 580 '/usr/lib'+ 581 '/opt/local/lib'+ 582 'anaconda/lib')

I thought to edit the file after reading https://github.com/bastibe/transplant/issues/40 < this post. I do not have access to dlopen. I am also quite new to python.

When running my app, I get the error:

Error loading libzmq: Undefined function or variable 'notfound'.

Thanks for your attention.

tombadmanship avatar Jan 25 '18 22:01 tombadmanship

Hi,

Transplant should find your anaconda's libzmq, and adds the conda lib directory in transplant_master.py:591 (sys.prefix + '/' + libzmq).

Did you check in ~/anaconda/lib if it actually contains a libzmq? I have a feeling that you simply have no zmq installed on your computer. Maybe conda install zmq helps.

bastibe avatar Jan 26 '18 07:01 bastibe

I did check ... it is definitely in there. It's confusing to me why transplant could not find it, I didn't see any issues brought up on the app page suggesting transplant, either. This leads me to think its something strange about the way my mac is set up (I also figured out why man dlopen was not working).

I was able to solve the problem last night by inserting the library directly into the folder with the app.

tombadmanship avatar Jan 26 '18 17:01 tombadmanship

If you want to debug this further, could you tell me the full path and file name of your libzmq and the value of your sys.prefix? I'd like to prevent problems like these from happening again in the future, if possible.

bastibe avatar Jan 27 '18 09:01 bastibe

I agree. This has caused some frustration. Now that transplant works with my hacky solution, I'm happy with transplant.

Full path to libzmq:

/anaconda/lib

sys.prefix:

/Users/new/anaconda

Thanks, Bastian.

On Sat, Jan 27, 2018 at 1:38 AM, Bastian Bechtold [email protected] wrote:

If you want to debug this further, could you tell me the full path and file name of your libzmq and the value of your sys.prefix? I'd like to prevent problems like these from happening again in the future, if possible.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bastibe/transplant/issues/58#issuecomment-360973082, or mute the thread https://github.com/notifications/unsubscribe-auth/AiKT742x6aN4lkyFVMzwTlx0z97vax8eks5tOu6WgaJpZM4Rtnq5 .

tombadmanship avatar Jan 29 '18 18:01 tombadmanship

It seems that some recent version of anaconda changed the install location of the libzmq binary. I uploaded a new version of Transplant, which should fix your problem. Can you confirm this?

bastibe avatar Jan 30 '18 08:01 bastibe

Sure, let me download it.

On Tue, Jan 30, 2018 at 12:00 AM, Bastian Bechtold <[email protected]

wrote:

It seems that some recent version of anaconda changed the install location of the libzmq binary. I uploaded a new version of Transplant, which should fix your problem. Can you confirm this?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bastibe/transplant/issues/58#issuecomment-361506329, or mute the thread https://github.com/notifications/unsubscribe-auth/AiKT7zyTxj3izogRnxUJlLcF0ndwQ1EHks5tPswggaJpZM4Rtnq5 .

tombadmanship avatar Jan 30 '18 17:01 tombadmanship

It is committed, and uploaded to PyPi.

bastibe avatar Jan 31 '18 15:01 bastibe

Transplant still doesn't find libzmq if it is not placed in my working directory.

On Wed, Jan 31, 2018 at 7:41 AM, Bastian Bechtold [email protected] wrote:

It is committed, and uploaded to PyPi.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bastibe/transplant/issues/58#issuecomment-361971040, or mute the thread https://github.com/notifications/unsubscribe-auth/AiKT7zqljpkkeKI4B3lR5Hro-FFq2fx2ks5tQIlFgaJpZM4Rtnq5 .

tombadmanship avatar Jan 31 '18 17:01 tombadmanship

Ok, I have to ask: when you said your libzmq is in /anaconda/lib, did you really mean that, or did you mean ~/anaconda/lib (aka /Users/new/anaconda/lib)? Because if you really meant that, then your sys.prefix does not point to your anaconda installation, which is probably the cause of your troubles.

bastibe avatar Feb 01 '18 07:02 bastibe

What you have said is correct. My actual anaconda installation is /Users/new/anaconda/lib.

On Wed, Jan 31, 2018 at 11:33 PM, Bastian Bechtold <[email protected]

wrote:

Ok, I have to ask: when you said your libzmq is in /anaconda/lib, did you really mean that, or did you mean ~/anaconda/lib (aka /Users/new/anaconda/lib)? Because if you really meant that, then your sys.prefix does not point to your anaconda installation, which is probably the cause of your troubles.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bastibe/transplant/issues/58#issuecomment-362182252, or mute the thread https://github.com/notifications/unsubscribe-auth/AiKT7yIQYAjJjcBsS83GVZgqO0sJs5_yks5tQWjggaJpZM4Rtnq5 .

tombadmanship avatar Feb 01 '18 17:02 tombadmanship

I don't get it. Line 582 (search_dirs.append(sys.prefix + '/lib')) explicitly includes this directory.

Unless... Can you tell me the exact file name of the libzmq in /Users/new/anaconda/lib, and the output of ctypes.util.find_library('zmq')? Maybe there is a mismatch for some reason?

bastibe avatar Feb 02 '18 10:02 bastibe

I also don't entirely get it. The paths you specify in transplant point directly to it.

In [6]: ctypes.util.find_library('zmq')

Out[6]: 'libzmq.dylib'

On Fri, Feb 2, 2018 at 2:08 AM, Bastian Bechtold [email protected] wrote:

I don't get it. Line 582 https://github.com/bastibe/transplant/blob/master/transplant/transplant_master.py#L592 (search_dirs.append(sys.prefix + '/lib')) explicitly includes this directory.

Unless... Can you tell me the exact file name of the libzmq in /Users/new/anaconda/lib, and the output of ctypes.util.find_library('zmq')? Maybe there is a mismatch for some reason?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bastibe/transplant/issues/58#issuecomment-362543423, or mute the thread https://github.com/notifications/unsubscribe-auth/AiKT7ye280IpigT3TQgS_e_71h4BvQCkks5tQt6qgaJpZM4Rtnq5 .

tombadmanship avatar Feb 05 '18 19:02 tombadmanship

I can't figure this one out from afar. My best guess is that something is wrong with your Python installation, but I honestly don't know.

I'll leave this issue open for the time being, maybe someone else will chime in with the same problem.

bastibe avatar Feb 08 '18 13:02 bastibe