<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"Segoe UI";
panose-1:2 11 5 2 4 2 4 2 2 3;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Verdana",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif">Hi Benjamin,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif">Thnx for your response.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif">I am having the issue when using PaperSpace Gradient.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif">Here the Ubuntu version info is:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif">DISTRIB_ID=Ubuntu<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif">DISTRIB_RELEASE=20.04<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif">DISTRIB_CODENAME=focal<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif">DISTRIB_DESCRIPTION="Ubuntu 20.04.4 LTS"<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif">NAME="Ubuntu"<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif">VERSION="20.04.4 LTS (Focal Fossa)"<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif">.and python version 3.9.13<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif">In /usr/lib/python3/dist-packages I do indeed find openslide and openslide_python-1.3.1.egg-info, and nothing similar in /usr/lib/python3.9.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif">A subsequent pip install openslide-python does not help. Any suggestions to do this from command line? Like downgrading to python 3.8?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif">On a couple of different platforms (hosted by a Danish university) openslide imports successfully and runs perfectly. These use Ubuntu 22.04.3 LTS x86_64 and Python 3.10.12<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif">Best,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif">Finn<o:p></o:p></span></p>
<div>
<p class="MsoNormal" style="line-height:8.0pt"><span style="font-size:7.5pt;font-family:"Verdana",sans-serif;color:gray;mso-fareast-language:DA"><o:p> </o:p></span></p>
<p class="MsoNormal" style="line-height:8.0pt"><b><span lang="DA" style="font-size:7.5pt;font-family:"Verdana",sans-serif;color:gray">Finn Benned Hansen<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height:8.0pt"><span lang="DA" style="font-size:7.5pt;font-family:"Verdana",sans-serif;color:gray;mso-fareast-language:DA">Gæsteforsker</span><span lang="DA" style="font-size:7.5pt;font-family:"Verdana",sans-serif;color:black;mso-fareast-language:DA"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:8.0pt"><span lang="DA" style="font-size:7.5pt;font-family:"Verdana",sans-serif;color:gray;mso-fareast-language:DA"><o:p> </o:p></span></p>
<p class="MsoNormal" style="line-height:8.0pt"><b><span lang="DA" style="font-size:7.5pt;font-family:"Verdana",sans-serif;color:gray">Københavns Universitet<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height:8.0pt"><span lang="DA" style="font-size:7.5pt;font-family:"Verdana",sans-serif;color:gray;mso-fareast-language:DA">Biomedicinsk Institut<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:8.0pt"><span lang="DA" style="font-size:7.5pt;font-family:"Verdana",sans-serif;color:gray;mso-fareast-language:DA">Blegdamsvej 3<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:8.0pt"><span lang="DA" style="font-size:7.5pt;font-family:"Verdana",sans-serif;color:gray;mso-fareast-language:DA">København N.<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:8.0pt"><span lang="DA" style="font-size:7.5pt;font-family:"Verdana",sans-serif;color:gray;mso-fareast-language:DA"><o:p> </o:p></span></p>
<p class="MsoNormal" style="line-height:8.0pt"><span lang="DA" style="font-size:7.5pt;font-family:"Verdana",sans-serif;color:gray;mso-fareast-language:DA"><a href="mailto:finn.hansen@sund.ku.dk" title="finn.hansen@sund.ku.dk"><u><span style="color:gray;text-decoration:none">finn.hansen@sund.ku.dk</span></u></a><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:8.0pt"><span lang="DA" style="font-size:7.5pt;font-family:"Verdana",sans-serif;color:gray;mso-fareast-language:DA"><o:p> </o:p></span></p>
<p class="MsoNormal" style="line-height:12.0pt"><span style="font-size:7.5pt;font-family:"Verdana",sans-serif;color:gray"><img border="0" width="251" height="87" style="width:2.6145in;height:.9062in" id="Picture_x0020_2" src="cid:image001.png@01DA4EDD.68BBFBA0" alt="Logo for Københavns Universitet"></span><span lang="DA" style="font-size:7.5pt;font-family:"Verdana",sans-serif;color:gray">
</span><span lang="DA" style="font-size:7.5pt;font-family:"Verdana",sans-serif;color:gray;mso-fareast-language:DA"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:8.0pt"><span lang="DA" style="font-size:7.5pt;font-family:"Verdana",sans-serif;color:gray;mso-fareast-language:DA"><o:p> </o:p></span></p>
<p class="MsoNormal" style="line-height:8.0pt"><span lang="DA" style="font-size:7.5pt;font-family:"Verdana",sans-serif;color:gray;mso-fareast-language:DA"><a href="https://informationssikkerhed.ku.dk/persondatabeskyttelse/privatlivspolitik/"><u><span style="color:gray;text-decoration:none">Sådan
beskytter vi persondata</span></u></a><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:8.0pt"><span style="font-size:7.5pt;font-family:"Verdana",sans-serif;color:gray;mso-fareast-language:DA"><o:p> </o:p></span></p>
<p class="MsoNormal" style="line-height:8.0pt"><span lang="DA" style="font-size:7.5pt;font-family:"Verdana",sans-serif;color:gray;mso-fareast-language:DA"><o:p> </o:p></span></p>
<p class="MsoNormal" style="line-height:8.0pt"><span lang="DA" style="font-size:7.5pt;font-family:"Verdana",sans-serif;color:gray;mso-fareast-language:DA"><o:p> </o:p></span></p>
</div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Benjamin Gilbert <bgilbert+openslide@cs.cmu.edu>
<br>
<b>Sent:</b> 23. januar 2024 18:13<br>
<b>To:</b> Finn Benned Hansen <finn.hansen@sund.ku.dk><br>
<b>Cc:</b> openslide-users@lists.andrew.cmu.edu<br>
<b>Subject:</b> Re: Error import openslide<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" align="left" width="100%" style="width:100.0%">
<tbody>
<tr>
<td style="background:#A6A6A6;padding:5.25pt 1.5pt 5.25pt 1.5pt"></td>
<td width="100%" style="width:100.0%;background:#EAEAEA;padding:5.25pt 3.75pt 5.25pt 11.25pt;word-wrap:break-word">
<div>
<p class="MsoNormal" style="mso-element:frame;mso-element-frame-hspace:2.25pt;mso-element-wrap:around;mso-element-anchor-vertical:paragraph;mso-element-anchor-horizontal:column;mso-height-rule:exactly">
<span style="font-size:9.0pt;font-family:"Segoe UI",sans-serif;color:#212121">Du får ikke ofte mails fra
<a href="mailto:bgilbert+openslide@cs.cmu.edu">bgilbert+openslide@cs.cmu.edu</a>.
<a href="https://aka.ms/LearnAboutSenderIdentification">Få mere at vide om, hvorfor dette er vigtigt</a><o:p></o:p></span></p>
</div>
</td>
<td width="10" style="width:56.25pt;background:#EAEAEA;padding:5.25pt 3.75pt 5.25pt 3.75pt;word-wrap:break-word;align:left">
</td>
</tr>
</tbody>
</table>
<div>
<div>
<div>
<div>
<p class="MsoNormal">On Tue, Jan 23, 2024 at 10:28 AM Finn Benned Hansen <<a href="mailto:finn.hansen@sund.ku.dk">finn.hansen@sund.ku.dk</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif">Used below to install Openslide and python3-openslide as described @
<a href="https://launchpad.net/~openslide/+archive/ubuntu/openslide" target="_blank">
https://launchpad.net/~openslide/+archive/ubuntu/openslide</a>:</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif">When trying to ‘import openslide’ in a python 3.9.13 environment I get the following error message:</span>
<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif"> </span><o:p></o:p></p>
<p class="MsoNormal"><i><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:red">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)</span></i><o:p></o:p></p>
</div>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">You don't say what Ubuntu version you're using, but I'd guess that you're trying to use a Python version that isn't the Ubuntu default. Is that correct? The compiled binary for openslide._convert is included in the .deb package, but because
of how C extension modules work, it will only load on the Python 3.Y version it was compiled for. However, Python .debs always install into the unversioned /usr/lib/python3/dist-packages directory, not a versioned /usr/lib/python3.9, so the package import
finds the pure Python code but fails to load the extension module.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">If you need to use a non-default version of Python, you should probably just install OpenSlide Python with pip. The upcoming OpenSlide Python 1.4.0 will include binary wheels for Linux, but for now, you'll need GCC and Python headers installed.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Best,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">--Benjamin Gilbert<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</div>
</body>
</html>