[MacPorts] #63492: py37-openslide @1.1.2_1: OSError: dlopen(libopenslide.0.dylib, 6): image not found
MacPorts
noreply at macports.org
Thu Sep 16 13:29:49 UTC 2021
#63492: py37-openslide @1.1.2_1: OSError: dlopen(libopenslide.0.dylib, 6): image
not found
--------------------------------------+----------------------
Reporter: DavidBAEpstein | Owner: bgilbert
Type: defect | Status: assigned
Priority: Normal | Milestone:
Component: ports | Version: 2.7.1
Resolution: | Keywords:
Port: openslide, py-openslide |
--------------------------------------+----------------------
Comment (by reneeotten):
Replying to [comment:8 DavidBAEpstein]:
> Here is what happened:
> Outside any virtual environment Macports' python3.7 accepts "import
openslide" without demur. This is python 3.7.12, rather than my virtual
environment's python 3.7.11. But I don't suppose that makes any
difference.
>
> I ran recursive diff on the two site packages for openslide, one from
the conda virtual environment, and one from /opt/local, that is from
Macports. Yes, these do differ, but only in the binary files. I suppose
this is caused by the use of different compilers.
I agree that the Python version does not make a difference and the fact
that it works tells us that there isn't anything wrong with the MacPorts
provided {{{py-openslide}}} port.
> The upshot is that I still don't understand what is going on. Benjamin
Gilbert, the owner of the port on Macports, has written to me that the
virtual environment may be the cause of the problem, which is also what
you think. But I don't think he believes that the problem is the use of
conda with Macports. I believe (without evidence) that, if I were to use
Brew, the problem would go away.
It's quite clear what is going on I think (based on your description and
log files): you installed {{{conda}}} and created an (virtual) environment
with it, then you installed {{{openslide}}} using {{{pip}}}, and then it
tries to use the {{{openslide}}} library provided by MacPorts. So that's
combining three different package managers, which is honestly asking for
this kind of trouble. Of course, I am not saying that this can never work
and it might be possible to work around the issues... but it's likely
going to be hard. Additionally, I wouldn't consider really a MacPorts
problem so don't know if anyone here would do it.
> Of course, this leaves me in exactly the same position I was in before,
but with a little more knowledge. I am working as a small cog in a large
software project, so a virtual environment is essential for me. The
virtual environment I created to investigate the bug is the smallest
possible to display the bug, and therefore (I thought) the least likely to
cause a problem.
I think the following options should work (please note, not tested):
(1) use MacPorts and pip:
- install {{{openslide}}} and {{{pyXY-virtualenv}}} with MacPorts (XY
could be 37 for Python 3.7 or any other version you would like)
- create a virtual environment ({{{virtualenv-X.Y
/path_to_where_you_want_to_create_it && source
/path_to_where_you_want_to_create_it/bin/activate}}})
- install the packages with {{{pip}}}: {{{pip install python-openslide}}}
(2) use only Anaconda/miniconda:
- create an environment with {{{conda}}}
- install the required packages with conda (and *not* pip), for example
from the bioconda channel: {{{conda install openslide-python openslide
--channel bioconda}}}
In both cases you should get a self-consistent set of packages and
hopefully that will get you back in a working situation.
--
Ticket URL: <https://trac.macports.org/ticket/63492#comment:9>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list