Re: [Qgis-user] FW: Couldn't load SIP module - Windows 10

2021-10-06 Per discussione Fred Perloff
Thanks for the heads up on QGIS from conda-forge vs QGIS from osgeow4.

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. 

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.

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.

I’m stumped trying to get the kids to play together nicely! 

Fred

From: Alexandre Neto
Sent: Wednesday, October 6, 2021 2:43 AM
To: Fred Perloff
Cc: rdmaili...@duif.net; qgis-user@lists.osgeo.org
Subject: Re: [Qgis-user] FW: Couldn't load SIP module - Windows 10

Meanwhile, I have been installing anaconda on a windows machine, and I saw 
something new.
Have you set Anaconda python to be the default python? I think you shouldn't.

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. 

Alexandre Neto

On Tue, Oct 5, 2021 at 8:12 PM Fred Perloff  wrote:
Prior to starting QGIS:
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
PYTHONHOME=C:\PROGRA~1\QGIS32~1.3\apps\Python39
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;
QGIS_PREFIX_PATH=C:/PROGRA~1/QGIS32~1.3/apps/qgis
QT_PLUGIN_PATH=C:\PROGRA~1\QGIS32~1.3\apps\qgis\qtplugins;C:\PROGRA~1\QGIS32~1.3\apps\qt5\plugins
 
After starting QGIS from OSGeo4W shell:
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
PYTHONHOME=C:\PROGRA~1\QGIS32~1.3\apps\Python39
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;
QGIS_PREFIX_PATH=C:/PROGRA~1/QGIS32~1.3/apps/qgis
QT_PLUGIN_PATH=C:\PROGRA~1\QGIS32~1.3\apps\qgis\qtplugins;C:\PROGRA~1\QGIS32~1.3\apps\qt5\plugins
 
PYTHONPATH is owned by Anaconda – QGIS doesn’t seem to touch that variable.
When QGIS starts, it prepends apps\qgis\bin and app\Python39\Scripts to the PATH
 
I started python from the OSGeo4W console. Here’s output of sys.path:
 
['', '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']
 
Anaconda goes first, before QGIS. I’m not surprised that QGIS can’t find its 
modules.
 
I think I’ll uninstall QGIS, and reinstall from conda-forge.
 
From: Richard Duivenvoorde
Sent: Sunday, October 3, 2021 2:59 AM
To: qgis-user@lists.osgeo.org
Cc: Fred Perloff
Subject: Re: [Qgis-user] FW: Couldn't load SIP module - Windows 10
 
On 10/2/21 8:35 PM, Fred Perloff wrote:
> Thank you for your prompt and insightful replies!
> 
> 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.
> 
> 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 
> pat

Re: [Qgis-user] FW: Couldn't load SIP module - Windows 10

2021-10-05 Per discussione Fred Perloff
Prior to starting QGIS:
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
PYTHONHOME=C:\PROGRA~1\QGIS32~1.3\apps\Python39
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;
QGIS_PREFIX_PATH=C:/PROGRA~1/QGIS32~1.3/apps/qgis
QT_PLUGIN_PATH=C:\PROGRA~1\QGIS32~1.3\apps\qgis\qtplugins;C:\PROGRA~1\QGIS32~1.3\apps\qt5\plugins

After starting QGIS from OSGeo4W shell:
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
PYTHONHOME=C:\PROGRA~1\QGIS32~1.3\apps\Python39
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;
QGIS_PREFIX_PATH=C:/PROGRA~1/QGIS32~1.3/apps/qgis
QT_PLUGIN_PATH=C:\PROGRA~1\QGIS32~1.3\apps\qgis\qtplugins;C:\PROGRA~1\QGIS32~1.3\apps\qt5\plugins

PYTHONPATH is owned by Anaconda – QGIS doesn’t seem to touch that variable.
When QGIS starts, it prepends apps\qgis\bin and app\Python39\Scripts to the PATH

I started python from the OSGeo4W console. Here’s output of sys.path:

['', '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']

Anaconda goes first, before QGIS. I’m not surprised that QGIS can’t find its 
modules.

I think I’ll uninstall QGIS, and reinstall from conda-forge.

From: Richard Duivenvoorde
Sent: Sunday, October 3, 2021 2:59 AM
To: qgis-user@lists.osgeo.org
Cc: Fred Perloff
Subject: Re: [Qgis-user] FW: Couldn't load SIP module - Windows 10

On 10/2/21 8:35 PM, Fred Perloff wrote:
> Thank you for your prompt and insightful replies!
> 
> 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.
> 
> 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.

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).

Also: not only check python but also available QT/sip related environment 
variables.

Another check: 
(mmm wanted to ask you to check sys.path in python console in QGIS... but THAT 
you do not have :-)
Then: for the osgeo4w.bat terminal start python and in that console:
import sys
print(sys.path)
and check which path's osgeo4w python is seeing/using?

(note: you could do the same in the conda environment)

Another work around: do not use the osgeo4w QGIS, but the conda QGIS?

Regards,

Richard Duivenvoorde

___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] Couldn't load SIP module - Windows 10

2021-10-02 Per discussione Fred Perloff
Just for grins, I uninstalled Anaconda. I started QGIS and Python support WAS 
enabled. Clearly there is a problem with Anaconda and QGIS learning to play 
together!


Fred Perloff
f...@perloff.us

From: Alexandre Neto
Sent: Saturday, October 2, 2021 1:12 AM
To: Richard Duivenvoorde
Cc: Fred Perloff; QGIS User
Subject: Re: [Qgis-user] Couldn't load SIP module - Windows 10

There shouldn't be any problems in using conda and osgeo4w side by side, they 
should both have isolated python environments.

If I remember well, during conda installation you are asked if you want to add 
conda to the PATH environment variable (can't remember the exact wording), you 
need to say NO. Otherwise conda python will be the default python on your 
machine.

I agree with Richard, don't mess with osgeo4w scripts or you will end up with 
with an even worst mess.

Alexandre Neto
A sábado, 2/10/2021, 08:32, Richard Duivenvoorde  escreveu:
Hi Fred,

I think indeed the source of your problem is the mixing of different versions 
of python: the one in osgeo4w and the Conda one. When SIP is not loaded 
correctly, you will not have any python based stuff in QGIS (so no plugins and 
processing).

The osgeo4w scripts normally 'isolate' the (python) paths pretty good. If I'm 
correct by actually even clearing your own PATH variable  (??)
But I think that Conda add's it's path's to your normal (python)path's (PATH or 
PYTHONPATH) variables.

For what I know you should not have  to 'fix' things in the osgeo4w scripts, 
better to make sure your system PATH is not filled with PYTHONPATH's or 
python/bin dirs in PATH.

You could try to start the osgeo4w 'terminal' and check what the environment 
variables PATH and PYTHONPATH are there. If you see conda-paths in it, these 
should be removed (either by removing them from your environment (but then you 
have to 'fix' conda) or by clearing them in the osgeo4w bat files...

Hope this helps, regards,

Richard Duivenvoorde



On 10/2/21 1:14 AM, Fred Perloff wrote:
> Hi,
> 
> After a fresh install of OSGeo4W network installer, I start QGISD Desktop.  A 
> python error box pops up with the error copied below. I close the error 
> window and the program loads. However, if I click on plugins settings, I 
> receive the error: No Python support detected.
> 
> I suspect I know the source of the problem. I have installed Python from 
> Anaconda. Anaconda uses an older version of Python and of qt. I modified 
> C:\OSGeo4W\etc\ini\python3.bat by prepending 
> %OSGEO4W_ROOT%\apps\Python39;%OSGEO4W_ROOT%\apps\Python39\Lib;%OSGEO4W_ROOT%\apps\Python39\Lib\site-packages;
>  to PYTHONPATH. There's a curious mix of / and escaped \\ in the resulting 
> path.
> 
> How do I enable loading python __init__.py when the desktop starts?
> Thanks!
> 
> Error window:
> 
> Couldn't load SIP module.
> Python support will be disabled.
> 
> Traceback (most recent call last):
> File "", line 1, in
> File "C:\OSGeo4W/apps/qgis/./python\qgis\__init__.py", line 82, in
> from qgis.PyQt import QtCore
> File "C:\OSGeo4W/apps/qgis/./python\qgis\PyQt\QtCore.py", line 24, in
> from PyQt5.QtCore import *
> ImportError: DLL load failed while importing QtCore: The specified procedure 
> could not be found.
> 
> Python version:
> 3.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)]
> QGIS version:
> 3.20.3-Odense 'Odense', 495fbaec
> Python path:
> ['C:/OSGeo4W/apps/qgis/./python', 
> 'C:/Users/Fred/AppData/Roaming/QGIS/QGIS3\\profiles\\default/python', 
> 'C:/Users/Fred/AppData/Roaming/QGIS/QGIS3\\profiles\\default/python/plugins', 
> 'C:/OSGeo4W/apps/qgis/./python/plugins', '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:\\Users\\Fred\\Documents', 'C:\\OSGeo4W\\bin\\python39.zip', 
> 'C:\\OSGeo4W\\apps\\Python39\\DLLs', 'C:\\OSGeo4W\\apps\\Python39\\lib', 
> 'C:\\OSGeo4W\\bin', 'C:\\OSGeo4W\\apps\\Python39', 
> 'C:\\OSGeo4W\\apps\\Python39\\lib\\site-packages', 
> 'C:\\OSGeo4W\\apps\\Python39\\lib\\site-packages\\win32', 
> 'C:\\OSGeo4W\\apps\\Python39\\lib\\site-packages\\win32\\lib', 
> 'C:\\OSGeo4W\\apps\\Python39\\lib\\site-packages\\Pythonwin']
> OS version: Windows 10 Version 2009
> QGIS version: 3.20.3-Odense 495fbaec
> Qt version: 5.15.2
> Python version: 3.9.5
> Windows 10 Pro
> 
> Fred Perloff
> f...@perloff.us
> 
> ___
> Qgis-user mailing list
> Qgis-user@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>

[Qgis-user] FW: Couldn't load SIP module - Windows 10

2021-10-02 Per discussione Fred Perloff
Thank you for your prompt and insightful replies! 

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.

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.

Have any other thoughts on how to obtain Python support in QGIS?

Fred

Couldn't load SIP module.
Python support will be disabled.

Traceback (most recent call last):
  File "", line 1, in 
  File "C:\PROGRA~1/QGIS32~1.3/apps/qgis/./python\qgis\__init__.py", line 82, 
in 
    from qgis.PyQt import QtCore
  File "C:\PROGRA~1/QGIS32~1.3/apps/qgis/./python\qgis\PyQt\QtCore.py", line 
24, in 
    from PyQt5.QtCore import *
ImportError: DLL load failed while importing QtCore: The specified procedure 
could not be found.
Python version:
3.9.5 (tags/v3.9.5:0a7dcbd, May  3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)]

QGIS version:
3.20.3-Odense 'Odense', 495fbaec

Python path:
['C:/PROGRA~1/QGIS32~1.3/apps/qgis/./python', 
'C:/Users/Fred/AppData/Roaming/QGIS/QGIS3\\profiles\\default/python', 
'C:/Users/Fred/AppData/Roaming/QGIS/QGIS3\\profiles\\default/python/plugins', 
'C:/PROGRA~1/QGIS32~1.3/apps/qgis/./python/plugins', 
'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:\\Users\\Fred\\Documents', 'C:\\Program Files\\QGIS 
3.20.3\\bin\\python39.zip', 'C:\\PROGRA~1\\QGIS32~1.3\\apps\\Python39\\DLLs', 
'C:\\PROGRA~1\\QGIS32~1.3\\apps\\Python39\\lib', 'C:\\Program Files\\QGIS 
3.20.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']

From: Alexandre Neto
Sent: Saturday, October 2, 2021 1:12 AM
To: Richard Duivenvoorde
Cc: Fred Perloff; QGIS User
Subject: Re: [Qgis-user] Couldn't load SIP module - Windows 10

There shouldn't be any problems in using conda and osgeo4w side by side, they 
should both have isolated python environments.

If I remember well, during conda installation you are asked if you want to add 
conda to the PATH environment variable (can't remember the exact wording), you 
need to say NO. Otherwise conda python will be the default python on your 
machine.

I agree with Richard, don't mess with osgeo4w scripts or you will end up with 
with an even worst mess.

Alexandre Neto
A sábado, 2/10/2021, 08:32, Richard Duivenvoorde  escreveu:
Hi Fred,

I think indeed the source of your problem is the mixing of different versions 
of python: the one in osgeo4w and the Conda one. When SIP is not loaded 
correctly, you will not have any python based stuff in QGIS (so no plugins and 
processing).

The osgeo4w scripts normally 'isolate' the (python) paths pretty good. If I'm 
correct by actually even clearing your own PATH variable  (??)
But I think that Conda add's it's path's to your normal (python)path's (PATH or 
PYTHONPATH) variables.

For what I know you should not have  to 'fix' things in the osgeo4w scripts, 
better to make sure your system PATH is not filled with PYTHONPATH's or 
python/bin dirs in PATH.

You could try to start the osgeo4w 'terminal' and check what the environment 
variables PATH and PYTHONPATH are there. If you see conda-paths in it, these 
should be removed (either by removing them from your environment (but then you 
have to 'fix' conda) or by clearing them in the osgeo4w bat files...

Hope this helps, regards,

Richard Duivenvoorde



On 10/2/21 1:14 AM, Fred Perloff wrote:
> Hi,
> 
> After a fresh install of OSGeo4W network installer, I start QGISD Desktop.  A 
> python error box pops up with the error copied below. I close the error 
> window and the program loads. However, if I click on plugins settings, I 
> receive the error: No Python support detected.
> 
> I suspect I know the source of the problem. I have installed Python from 
> Anaconda. Anaconda uses an older version of Python and of qt. I modified 
> C:\OSGeo4W\etc\ini\python3.bat by prepending 
> %OSGEO4W_ROOT%\apps\Python39;%OSGEO4W_ROOT%\apps\Python39\Lib;%OSGEO4W_ROOT%\apps\Python39\Lib\site-packages;
>  to PYTHONPATH. There's a curious mix of / and escaped \\ in the resulting 
> path.
> 
> How do I enable loading python __init__.py when the desktop start

[Qgis-user] Couldn't load SIP module - Windows 10

2021-10-01 Per discussione Fred Perloff


 
 
  
   
Hi,

   
   

   
   
After a fresh install of OSGeo4W network installer, I start QGISD Desktop.  A python error box pops up with the error copied below. I close the error window and the program loads. However, if I click on plugins settings, I receive the error: No Python support detected.

   
   

   
   
I suspect I know the source of the problem. I have installed Python from Anaconda. Anaconda uses an older version of Python and of qt. I modified C:\OSGeo4W\etc\ini\python3.bat by prepending %OSGEO4W_ROOT%\apps\Python39;%OSGEO4W_ROOT%\apps\Python39\Lib;%OSGEO4W_ROOT%\apps\Python39\Lib\site-packages; to PYTHONPATH. There's a curious mix of / and escaped \\ in the resulting path.

   
   

   
   
How do I enable loading python __init__.py when the desktop starts?

   
   
Thanks!

   
   

   
   
Error window:

   
   

   
   
Couldn't load SIP module.
Python support will be disabled.
   
   
Traceback (most recent call last):
File "", line 1, in 
File "C:\OSGeo4W/apps/qgis/./python\qgis\__init__.py", line 82, in 
from qgis.PyQt import QtCore
File "C:\OSGeo4W/apps/qgis/./python\qgis\PyQt\QtCore.py", line 24, in 
from PyQt5.QtCore import *
ImportError: DLL load failed while importing QtCore: The specified procedure could not be found.
   
   
Python version:
3.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)]
   
   
QGIS version:
3.20.3-Odense 'Odense', 495fbaec
   
   
Python path:
['C:/OSGeo4W/apps/qgis/./python', 'C:/Users/Fred/AppData/Roaming/QGIS/QGIS3\\profiles\\default/python', 'C:/Users/Fred/AppData/Roaming/QGIS/QGIS3\\profiles\\default/python/plugins', 'C:/OSGeo4W/apps/qgis/./python/plugins', '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:\\Users\\Fred\\Documents', 'C:\\OSGeo4W\\bin\\python39.zip', 'C:\\OSGeo4W\\apps\\Python39\\DLLs', 'C:\\OSGeo4W\\apps\\Python39\\lib', 'C:\\OSGeo4W\\bin', 'C:\\OSGeo4W\\apps\\Python39', 'C:\\OSGeo4W\\apps\\Python39\\lib\\site-packages', 'C:\\OSGeo4W\\apps\\Python39\\lib\\site-packages\\win32', 'C:\\OSGeo4W\\apps\\Python39\\lib\\site-packages\\win32\\lib', 'C:\\OSGeo4W\\apps\\Python39\\lib\\site-packages\\Pythonwin']
OS version: Windows 10 Version 2009
QGIS version: 3.20.3-Odense 495fbaec
Qt version: 5.15.2
Python version: 3.9.5
   
   
Windows 10 Pro

   
  
  
   

   
   
Fred Perloff
   
   
f...@perloff.us
   
  
 

___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user