I ran into an issue and had to reinstall QGIS 2.18, but I can't seem to get it to properly work though. Whenever I install it it says "QGIS 2.18 is already installed on your computer..." even though I delete every possible reference to QGIS in the registry, my files, etc... I continuously get this error at startup:

    Couldn't load QGIS utils.
Python support will be disabled.

Traceback (most recent call last):
  File "", line 1, in 
  File "C:/PROGRA~1/QGIS2~1.18/apps/qgis/./python\qgis\utils.py", line 21, in 
  File "C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\future\standard_library\__init__.py", line 457, in install_aliases
  File "C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\future\backports\__init__.py", line 17, in 
    from .misc import (ceil,
  File "C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\future\backports\misc.py", line 24, in 
    from socket import getaddrinfo, SOCK_STREAM, error, socket
  File "C:\Python27\ArcGIS10.4\Lib\socket.py", line 47, in 
    import _socket
ImportError: DLL load failed: %1 is not a valid Win32 application.

Python version:
2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)]

QGIS version:
2.18.3 'Las Palmas', 77b8c3d

Python path:
['C:/PROGRA~1/QGIS2~1.18/apps/qgis/./python', u'C:/Users/ac/.qgis2/python', u'C:/Users/ac/.qgis2/python/plugins', 'C:/PROGRA~1/QGIS2~1.18/apps/qgis/./python/plugins', 'C:\\PROGRA~1\\QGIS2~1.18\\apps\\Python27\\lib\\site-packages\\matplotlib-1.3.1-py2.7-win-amd64.egg', 'C:\\PROGRA~1\\QGIS2~1.18\\apps\\Python27\\lib\\site-packages\\nose-1.3.3-py2.7.egg', 'C:\\PROGRA~1\\QGIS2~1.18\\apps\\Python27\\lib\\site-packages\\tornado-4.0.1-py2.7-win-amd64.egg', 'C:\\PROGRA~1\\QGIS2~1.18\\apps\\Python27\\lib\\site-packages\\backports.ssl_match_hostname-', 'C:\\PROGRA~1\\QGIS2~1.18\\apps\\Python27\\lib\\site-packages\\certifi-14.05.14-py2.7.egg', 'C:\\Python27\\ArcGIS10.4\\Lib', 'C:\\Python27\\ArcGIS10.4\\DLLs', 'C:\\Python27\\ArcGIS10.4\\Lib\\lib-tk', 'C:\\another-library', 'C:\\PROGRA~1\\QGIS2~1.18\\bin\\python27.zip', 'C:\\PROGRA~1\\QGIS2~1.18\\apps\\Python27\\DLLs', 'C:\\PROGRA~1\\QGIS2~1.18\\apps\\Python27\\lib', 'C:\\PROGRA~1\\QGIS2~1.18\\apps\\Python27\\lib\\plat-win', 'C:\\PROGRA~1\\QGIS2~1.18\\apps\\Python27\\lib\\lib-tk', 'C:\\PROGRA~1\\QGIS2~1.18\\bin', 'C:\\PROGRA~1\\QGIS2~1.18\\apps\\Python27', 'C:\\PROGRA~1\\QGIS2~1.18\\apps\\Python27\\lib\\site-packages', 'C:\\PROGRA~1\\QGIS2~1.18\\apps\\Python27\\lib\\site-packages\\PIL', 'C:\\PROGRA~1\\QGIS2~1.18\\apps\\Python27\\lib\\site-packages\\jinja2-2.7.2-py2.7.egg', 'C:\\PROGRA~1\\QGIS2~1.18\\apps\\Python27\\lib\\site-packages\\markupsafe-0.23-py2.7-win-amd64.egg', 'C:\\PROGRA~1\\QGIS2~1.18\\apps\\Python27\\lib\\site-packages\\pytz-2012j-py2.7.egg', 'C:\\PROGRA~1\\QGIS2~1.18\\apps\\Python27\\lib\\site-packages\\win32', 'C:\\PROGRA~1\\QGIS2~1.18\\apps\\Python27\\lib\\site-packages\\win32\\lib', 'C:\\PROGRA~1\\QGIS2~1.18\\apps\\Python27\\lib\\site-packages\\Pythonwin', 'C:\\PROGRA~1\\QGIS2~1.18\\apps\\Python27\\lib\\site-packages\\Shapely-1.2.18-py2.7-win-amd64.egg', 'C:\\PROGRA~1\\QGIS2~1.18\\apps\\Python27\\lib\\site-packages\\wx-2.8-msw-unicode', 'C:\\PROGRA~1\\QGIS2~1.18\\apps\\Python27\\lib\\site-packages\\xlrd-0.9.2-py2.7.egg', 'C:\\PROGRA~1\\QGIS2~1.18\\apps\\Python27\\lib\\site-packages\\xlwt-0.7.5-py2.7.egg']

I've tried suggestions on similar posts but they're all from older versions of QGIS and are no longer relevant. I'm not sure if this has anything to do with it but I do also have Arc installed and I use that primarily. I know Arc installs Python a bit differently since it's native.

  • 1
    That ImportError usually means there is a 32bit vs 64bit python conflict. And looks like it's searching for python in both your ..\apps\lib\site-packages (QGIS) and C:\Python27 (ArcGIS) – SaultDon Jan 30 '17 at 23:10
  • Is there any way to change the path that it's looking in? – AGH_TORN Jan 31 '17 at 14:45

Figured it out. Apparently with GDAL installed and directing it towards my ArcGIS Python path, Q wouldn't work.

EDIT: To fix this, I removed any GDAL environment variables and reinstalled QGIS. I'm not sure that the reinstall was necessary but I did it to be safe.

| improve this answer | |
  • how did you fix it? – kflaw Apr 25 '17 at 20:17
  • Please, add your solution – TurboGraphxBeige Jul 19 '17 at 12:07
  • Could you post it as an answer and mark it as best answer? Or just edit the answer you posted before. – TurboGraphxBeige Jul 19 '17 at 22:48

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.