4

I recently installed QGIS 2.4, but Python does not load. I am running on a Windows 64 bit machine.

I receive the error message "Couldn't load SIP module Python support will be disabled".

Traceback (most recent call last): File "", line 1, in ImportError: DLL load failed: %1 is not a valid Win32 application.

I have another installation of Python at C:/Python27. It is the 32-bit version.

When I remove C:/Python27 folder, QGIS works fine, so there is some linkage between the new QGIS installation and the C:/Python27 python interpreter. I can't permanently delete C:/Python because I need it for other applications, so I am wondering if there are any suggestion as to how to fix this.

7

In a command window, type set > set.txt to get a list of all environment variables you have set. Your python installation may have set some values that QGIS does not like.

The PATH variable is save, because qgis.bat sets its own path variable, but PYTHONPATH or something else may be harmful.

Once you found a link to C:\Python27, go to the system properties and change the environment variable (not sure how the commands are in your language version).

  • Thanks Andre, I deleted out the PYTHONPATH links and the problem was solved. Interestingly, when I added them back into a new PYTHONPATH, QGIS/Python still work. – user44796 Jul 25 '14 at 19:12
1

Removing the PYTHONPATH environment variable as suggested above did not work in my case with QGIS 2.18.9 w/ GRASS x64 and python 2.7 on Win7. For some reason, I had to remove c:\python27 from my PATH (temporarily), and add the QGIS install python27 folder to my PYTHONPATH variable. Then QGIS 2.18.9 started up without this error. I was able to add c:\python27 back into my path and restart QGIS with no difficulty, and my python plugins are working again.

  • I found a (possibly) better solution. There is a python-core.bat in C:\Program Files\QGIS 2.18\etc\ini that sets up the python environment variables. I just added a: set PYTHONPATH=%OSGEO4W_ROOT%\apps\Python27;%OSGEO4W_ROOT%\apps\Python27\Lib;%OSGEO4W_ROOT%\apps\Python27\Lib\site-packages;%PYTHONPATH%. I also added the %OSGEO4W_ROOT%\apps\Python27 directory to the PATH on the next line. – Heath Jun 21 '17 at 14:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.