[prev in list] [next in list] [prev in thread] [next in thread] 

List:       macports-users
Subject:    Re: Explain how to respond to the error message: loading openslide
From:       "Epstein, David via macports-users" <macports-users () lists ! macports ! org>
Date:       2022-03-28 12:40:11
Message-ID: 79436274-6CAA-4A3C-9123-AFE764767749 () warwick ! ac ! uk
[Download RAW message or body]

[Attachment #2 (text/plain)]


On 27 Mar 2022, at 00:55, Ryan Schmidt \
<ryandesign@macports.org<mailto:ryandesign@macports.org>> wrote:

Please direct all mailing list questions to the addresses at \
lists.macports.org<http://lists.macports.org>, not the older addresses that were \
deprecated in late 2016. I've fixed the address in this reply.


On Mar 26, 2022, at 04:54, Epstein, David wrote:

I am using MacPorts base version 2.7.2 under OS 11.6.4.
All my dealings with MacPorts is done using sudo
I got the following error:

When doing what?

45 try
> 

---> 46     _lib = cdll.LoadLibrary('libopenslide.0.dylib')
    47 except OSError
> 

    48     # MacPorts doesn't add itself to the dyld search path, but
    49     # does add itself to the find_library() search path
    50     # (DEFAULT_LIBRARY_FALLBACK in ctypes.macholib.dyld) on
    51     # Python 2.6 and 2.7.  Python 3 users on MacPorts should add
    52     # the MacPorts lib directory to DYLD_LIBRARY_PATH.

Q1 Where is DYLD_LIBRARY_PATH defined?
Q2 What is the official pathname of the "MacPorts lib directory"?
Q3 How should I have found the answers to the above two questions, without
bothering macports-users?

It would be nice if the standard MacPorts distribution dealt with this
problem so that I didn't have to deal with it manually.

Normally, DYLD_LIBRARY_PATH should not be defined. It should only be set by a build \
system at very specific times when needed during the build. You should not need to \
set it after the build is done.

Sounds like whatever third-party software you're running here is under the mistaken \
belief that you should set DYLD_LIBRARY_PATH to some value when running their \
program. You should ask them to fix their program so that that is not necessary, \
because setting DYLD_LIBRARY_PATH other than at the very specific times I mentioned \
can cause unintended consequences. If they believe they need to set DYLD_LIBRARY_PATH \
because of some deficiency in MacPorts, they should be discussing that with us so \
that we can correct whatever the problem is.

If the software you're running was installed by a MacPorts port, we could patch it to \
fix the problem for them; if so, let us know what port it is.

The MacPorts library directory it's referring to would be whatever directory \
libopenslide.0.dylib is located in, which might be /opt/local/lib.

Thanks for the answers. The maintainer of macports openslide kindly wrote to me, \
basically to tell me that this is the same problem previously raised by me. (See \
https://trac.macports.org/ticket/63492). So, on the one hand, I shouldn't have needed \
to write again, but, on the other hand, after the most recent exchange of emails, I \
now understand much better why I'm getting problems, and should not have to write a \
third time on the same issue. The error occurred when I was trying to load openslide, \
following somewhat complex instructions in a python package about creating a \
particular virtual environment. The python package instructions told me to "port \
install openslide", but failed to say also to"port install py37-openslide". I think \
that the version of py37-openslide in my virtual environment at that time actually \
came from pypi.  So now the error message makes sense to me, which I find reassuring. \
And it was subsequently easy to modify my virtual enviroment so that everything now \
works.


[Attachment #3 (text/html)]

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: \
after-white-space;" class=""> <div dir="auto" style="word-wrap: break-word; \
-webkit-nbsp-mode: space; line-break: after-white-space;" class=""> <br class="">
<div>
<blockquote type="cite" class="">
<div class="">On 27 Mar 2022, at 00:55, Ryan Schmidt &lt;<a \
href="mailto:ryandesign@macports.org" class="">ryandesign@macports.org</a>&gt; \
wrote:</div> <br class="Apple-interchange-newline">
<div class="">
<div class="">Please direct all mailing list questions to the addresses at <a \
href="http://lists.macports.org" class=""> lists.macports.org</a>, not the older \
addresses that were deprecated in late 2016. I've fixed the address in this reply.<br \
class=""> <br class="">
<br class="">
On Mar 26, 2022, at 04:54, Epstein, David wrote:<br class="">
<br class="">
<blockquote type="cite" class="">I am using MacPorts base version 2.7.2 under OS \
11.6.4.<br class=""> All my dealings with MacPorts is done using sudo<br class="">
I got the following error:<br class="">
</blockquote>
<br class="">
When doing what?<br class="">
<br class="">
<blockquote type="cite" class="">45 try<br class="">
> <br class="">
<br class="">
---&gt; 46 &nbsp;&nbsp;&nbsp;&nbsp;_lib = cdll.LoadLibrary('libopenslide.0.dylib')<br \
class=""> &nbsp;&nbsp;&nbsp;&nbsp;47 except OSError<br class="">
> <br class="">
<br class="">
&nbsp;&nbsp;&nbsp;&nbsp;48 &nbsp;&nbsp;&nbsp;&nbsp;# MacPorts doesn't add itself to \
the dyld search path, but<br class=""> &nbsp;&nbsp;&nbsp;&nbsp;49 \
&nbsp;&nbsp;&nbsp;&nbsp;# does add itself to the find_library() search path<br \
class=""> &nbsp;&nbsp;&nbsp;&nbsp;50 &nbsp;&nbsp;&nbsp;&nbsp;# \
(DEFAULT_LIBRARY_FALLBACK in ctypes.macholib.dyld) on<br class=""> \
&nbsp;&nbsp;&nbsp;&nbsp;51 &nbsp;&nbsp;&nbsp;&nbsp;# Python 2.6 and 2.7. &nbsp;Python \
3 users on MacPorts should add<br class=""> &nbsp;&nbsp;&nbsp;&nbsp;52 \
&nbsp;&nbsp;&nbsp;&nbsp;# the MacPorts lib directory to DYLD_LIBRARY_PATH.<br \
class=""> <br class="">
Q1 Where is DYLD_LIBRARY_PATH defined?<br class="">
Q2 What is the official pathname of the "MacPorts lib directory"?<br class="">
Q3 How should I have found the answers to the above two questions, without<br \
class=""> bothering macports-users?<br class="">
<br class="">
It would be nice if the standard MacPorts distribution dealt with this<br class="">
problem so that I didn't have to deal with it manually.<br class="">
</blockquote>
<br class="">
Normally, DYLD_LIBRARY_PATH should not be defined. It should only be set by a build \
system at very specific times when needed during the build. You should not need to \
set it after the build is done.<br class=""> <br class="">
Sounds like whatever third-party software you're running here is under the mistaken \
belief that you should set DYLD_LIBRARY_PATH to some value when running their \
program. You should ask them to fix their program so that that is not necessary, \
because setting  DYLD_LIBRARY_PATH other than at the very specific times I mentioned \
can cause unintended consequences. If they believe they need to set DYLD_LIBRARY_PATH \
because of some deficiency in MacPorts, they should be discussing that with us so \
that we can correct  whatever the problem is.<br class="">
<br class="">
If the software you're running was installed by a MacPorts port, we could patch it to \
fix the problem for them; if so, let us know what port it is.<br class=""> <br \
class=""> The MacPorts library directory it's referring to would be whatever \
directory libopenslide.0.dylib is located in, which might be /opt/local/lib.<br \
class=""> </div>
</div>
</blockquote>
<br class="">
</div>
<div>Thanks for the answers. The maintainer of macports openslide kindly wrote to me, \
basically to tell me that this is the same problem previously raised by me. \
(See&nbsp;<a href="https://trac.macports.org/ticket/63492" \
class="">https://trac.macports.org/ticket/63492</a>).  So, on the one hand, I \
shouldn't have needed to write again, but, on the other hand, after the most recent \
exchange of emails, I now understand much better why I'm getting problems, and should \
not have to write a third time on the same issue. The error occurred  when I was \
trying to load openslide, following somewhat complex instructions in a python package \
about creating a particular virtual environment. The python package instructions told \
me to "port install openslide", but failed to say also to"port install \
py37-openslide".  I think that the version of py37-openslide in my virtual \
environment at that time actually came from pypi. &nbsp;So now the error message \
makes sense to me, which I find reassuring. And it was subsequently easy to modify my \
virtual enviroment so that everything  now works.</div>
</div>
</body>
</html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic