transplant
transplant copied to clipboard
Opening libzmq on mac
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.
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.
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.
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.
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 .
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?
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 .
It is committed, and uploaded to PyPi.
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 .
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.
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 .
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?
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 .
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.