<html 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)"><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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style></head><body lang=EN-US link=blue vlink="#954F72" style='word-wrap:break-word'><div class=WordSection1><p class=MsoNormal>Thanks for the heads up on QGIS from conda-forge vs QGIS from osgeow4.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I did not do anything to set Anaconda as the default python. In fact, during Anaconda installation, one is asked whether to modify the PATH to include Anaconda and is encouraged to say No. I said no. </p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I opened osgeo4w shell, ran qgis command, started a python console (which finds ver 3.9.5) from osgeo4w shell, and examined sys.path. As you might have expected, Anaconda python, dll’s, site-packages, win-32\lib all come before QGIS python, site-packages and lib.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I’ve tried installing Anaconda first, and QGIS second, as well as QGIS first and Anaconda second. In either scenario, QGIS cannot locate its python modules, and hence, no plugins are available nor can I use GRASS.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I’m stumped trying to get the kids to play together nicely! </p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Fred<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><div style='mso-element:para-border-div;border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal style='border:none;padding:0in'><b>From: </b><a href="mailto:senhor.neto@gmail.com">Alexandre Neto</a><br><b>Sent: </b>Wednesday, October 6, 2021 2:43 AM<br><b>To: </b><a href="mailto:fred@perloff.us">Fred Perloff</a><br><b>Cc: </b><a href="mailto:rdmailings@duif.net">rdmailings@duif.net</a>; <a href="mailto:qgis-user@lists.osgeo.org">qgis-user@lists.osgeo.org</a><br><b>Subject: </b>Re: [Qgis-user] FW: Couldn't load SIP module - Windows 10</p></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>Meanwhile, I have been installing anaconda on a windows machine, and I saw something new.</p></div><div><p class=MsoNormal>Have you set Anaconda python to be the default python? I think you shouldn't.</p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Please notice that QGIS on conda-forge is not as feature-rich as the one provided by osgeo4w. There's no GRASS or SAGA, no proprietary drivers to open ECW and other proprietary formats, and so on. </p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Alexandre Neto</p></div></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>On Tue, Oct 5, 2021 at 8:12 PM Fred Perloff <<a href="mailto:fred@perloff.us">fred@perloff.us</a>> wrote:</p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt'><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'>Prior to starting QGIS:</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'>Path=C:\PROGRA~1\QGIS32~1.3\apps\qt5\bin;C:\PROGRA~1\QGIS32~1.3\apps\Python39\Scripts;C:\PROGRA~1\QGIS32~1.3\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\WBem</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'>PYTHONHOME=C:\PROGRA~1\QGIS32~1.3\apps\Python39</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'>PYTHONPATH=C:\ProgramData\Anaconda3;C:\ProgramData\Anaconda3\DLLs;C:\ProgramData\Anaconda3\lib;C:\ProgramData\Anaconda3\lib\site-packages;C:\ProgramData\Anaconda3\lib\site-packages\win32;C:\ProgramData\Anaconda3\lib\site-packages\win32\lib;C:\ProgramData\Anaconda3\lib\site-packages\Pythonwin;</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'>QGIS_PREFIX_PATH=C:/PROGRA~1/QGIS32~1.3/apps/qgis</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'>QT_PLUGIN_PATH=C:\PROGRA~1\QGIS32~1.3\apps\qgis\qtplugins;C:\PROGRA~1\QGIS32~1.3\apps\qt5\plugins</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'> </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'>After starting QGIS from OSGeo4W shell:</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'>Path=C:\PROGRA~1\QGIS32~1.3\apps\qgis\bin;C:\PROGRA~1\QGIS32~1.3\apps\grass\grass78\lib;C:\PROGRA~1\QGIS32~1.3\apps\grass\grass78\bin;C:\PROGRA~1\QGIS32~1.3\apps\qt5\bin;C:\PROGRA~1\QGIS32~1.3\apps\Python39\Scripts;C:\PROGRA~1\QGIS32~1.3\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\WBem</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'>PYTHONHOME=C:\PROGRA~1\QGIS32~1.3\apps\Python39</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'>PYTHONPATH=C:\ProgramData\Anaconda3;C:\ProgramData\Anaconda3\DLLs;C:\ProgramData\Anaconda3\lib;C:\ProgramData\Anaconda3\lib\site-packages;C:\ProgramData\Anaconda3\lib\site-packages\win32;C:\ProgramData\Anaconda3\lib\site-packages\win32\lib;C:\ProgramData\Anaconda3\lib\site-packages\Pythonwin;</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'>QGIS_PREFIX_PATH=C:/PROGRA~1/QGIS32~1.3/apps/qgis</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'>QT_PLUGIN_PATH=C:\PROGRA~1\QGIS32~1.3\apps\qgis\qtplugins;C:\PROGRA~1\QGIS32~1.3\apps\qt5\plugins</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'> </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'>PYTHONPATH is owned by Anaconda – QGIS doesn’t seem to touch that variable.</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'>When QGIS starts, it prepends apps\qgis\bin and app\Python39\Scripts to the PATH</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'> </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'>I started python from the OSGeo4W console. Here’s output of sys.path:</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'> </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'>['', 'C:\\ProgramData\\Anaconda3', 'C:\\ProgramData\\Anaconda3\\DLLs', 'C:\\ProgramData\\Anaconda3\\lib', 'C:\\ProgramData\\Anaconda3\\lib\\site-packages', 'C:\\ProgramData\\Anaconda3\\lib\\site-packages\\win32', 'C:\\ProgramData\\Anaconda3\\lib\\site-packages\\win32\\lib', 'C:\\ProgramData\\Anaconda3\\lib\\site-packages\\Pythonwin', 'C:\\Program Files\\QGIS 3.20.3', 'C:\\PROGRA~1\\QGIS32~1.3\\bin\\python39.zip', 'C:\\PROGRA~1\\QGIS32~1.3\\apps\\Python39\\DLLs', 'C:\\PROGRA~1\\QGIS32~1.3\\apps\\Python39\\lib', 'C:\\PROGRA~1\\QGIS32~1.3\\bin', 'C:\\PROGRA~1\\QGIS32~1.3\\apps\\Python39', 'C:\\PROGRA~1\\QGIS32~1.3\\apps\\Python39\\lib\\site-packages', 'C:\\PROGRA~1\\QGIS32~1.3\\apps\\Python39\\lib\\site-packages\\win32', 'C:\\PROGRA~1\\QGIS32~1.3\\apps\\Python39\\lib\\site-packages\\win32\\lib', 'C:\\PROGRA~1\\QGIS32~1.3\\apps\\Python39\\lib\\site-packages\\Pythonwin']</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'> </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'>Anaconda goes first, before QGIS. I’m not surprised that QGIS can’t find its modules.</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'> </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'>I think I’ll uninstall QGIS, and reinstall from conda-forge.</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'> </p><div style='border:none;border-top:solid windowtext 1.0pt;padding:3.0pt 0in 0in 0in;border-color:currentcolor currentcolor'><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'><b>From: </b><a href="mailto:rdmailings@duif.net" target="_blank">Richard Duivenvoorde</a><br><b>Sent: </b>Sunday, October 3, 2021 2:59 AM<br><b>To: </b><a href="mailto:qgis-user@lists.osgeo.org" target="_blank">qgis-user@lists.osgeo.org</a><br><b>Cc: </b><a href="mailto:fred@perloff.us" target="_blank">Fred Perloff</a><br><b>Subject: </b>Re: [Qgis-user] FW: Couldn't load SIP module - Windows 10</p></div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'> </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'>On 10/2/21 8:35 PM, Fred Perloff wrote:</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'>> Thank you for your prompt and insightful replies!</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'>> </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'>> I decided to clean the slate – I uninstalled Anaconda & OsGEO4w, and rebooted. The PATH was clear of any references to python(s) and there were no PYTHONPATH or PYTHONHOME variables.</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'>> </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'>> I reinstalled Anaconda, and made sure that I did NOT add conda to PATH. I installed QGIS desktop 3.20 and started the program. I received a very similar error message to last time. Both QGIS and Anaconda write to “Python path,” though >QGIS entries are first in order.</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'> </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'>Can you start/stop QGIS from the osgeo4w.bat terminal and check the values of PATH and PYTHONPATH there? Just to be sure that osgeo4w is ONLY pointing to the python versions of osgeo4w (and not tainted by conda's).</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'> </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'>Also: not only check python but also available QT/sip related environment variables.</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'> </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'>Another check: </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'>(mmm wanted to ask you to check sys.path in python console in QGIS... but THAT you do not have :-)</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'>Then: for the osgeo4w.bat terminal start python and in that console:</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'>import sys</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'>print(sys.path)</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'>and check which path's osgeo4w python is seeing/using?</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'> </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'>(note: you could do the same in the conda environment)</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'> </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'>Another work around: do not use the osgeo4w QGIS, but the conda QGIS?</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'> </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'>Regards,</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'> </p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'>Richard Duivenvoorde</p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt'> </p></div></div></blockquote></div><p class=MsoNormal style='margin-left:4.8pt'>_______________________________________________<br>Qgis-user mailing list<br><a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a><br>List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>