Error import openslide

Finn Benned Hansen finn.hansen at sund.ku.dk
Tue Jan 23 04:17:21 EST 2024


Used below to install Openslide and python3-openslide as described @ https://launchpad.net/~openslide/+archive/ubuntu/openslide:

apt install software-properties-common
add-apt-repository ppa:openslide/openslide
# for OpenSlide:
apt install openslide-tools
# for OpenSlide Python:
apt install python3-openslide

When trying to 'import openslide' in a python 3.9.13 environment I get the following error message:

ImportError                               Traceback (most recent call last)
Input In [1], in <cell line: 1>()
----> 1 import openslide

File /usr/lib/python3/dist-packages/openslide/__init__.py:31, in <module>
     27 from io import BytesIO
     29 from PIL import Image, ImageCms
---> 31 from openslide import lowlevel
     33 # For the benefit of library users
     34 from openslide._version import __version__  # noqa: F401  module-imported-but-unused

File /usr/lib/python3/dist-packages/openslide/lowlevel.py:51, in <module>
     47 import platform
     49 from PIL import Image
---> 51 from . import _convert
     54 def _load_library():
     55     def try_load(names):

ImportError: cannot import name '_convert' from partially initialized module 'openslide' (most likely due to a circular import) (/usr/lib/python3/dist-packages/openslide/__init__.py)

Seems _convert is actually named _convert.c in the current github version - do I need to have a c++ compiler installed also to get this to work?

Best,

Finn Benned


Finn Benned Hansen
Gæsteforsker

Københavns Universitet
Biomedicinsk Institut
Blegdamsvej 3
København N.

finn.hansen at sund.ku.dk<mailto:finn.hansen at sund.ku.dk>

[Logo for Københavns Universitet]

Sådan beskytter vi persondata<https://informationssikkerhed.ku.dk/persondatabeskyttelse/privatlivspolitik/>




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.andrew.cmu.edu/pipermail/openslide-users/attachments/20240123/d94bdf1a/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 5568 bytes
Desc: image001.png
URL: <http://lists.andrew.cmu.edu/pipermail/openslide-users/attachments/20240123/d94bdf1a/attachment-0001.png>


More information about the openslide-users mailing list