2

I am getting the following error while executing Python code: An error has occurred while executing Python code:

ZeroDivisionError: float division by zero 
Traceback (most recent call last):
  File "C:/Users/goodwin/.qgis2/python/plugins\openlayers_plugin\openlayers_layer.py", line 120, in request
    self.setup_map()
  File "C:/Users/goodwin/.qgis2/python/plugins\openlayers_plugin\openlayers_layer.py", line 170, in setup_map
    qgisRes = rendererContext.extent().width() / self.targetSize.width()
ZeroDivisionError: float division by zero


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

Python Path:
C:/PROGRA~1/QGISES~1/apps/qgis/./python/plugins\processing
C:/PROGRA~1/QGISES~1/apps/qgis/./python
C:/Users/goodwin/.qgis2/python
C:/Users/goodwin/.qgis2/python/plugins
C:/PROGRA~1/QGISES~1/apps/qgis/./python/plugins
C:\PROGRA~1\QGISES~1\apps\Python27\lib\site-packages\matplotlib-1.3.1-py2.7-win-amd64.egg
C:\PROGRA~1\QGISES~1\apps\Python27\lib\site-packages\nose-1.3.3-py2.7.egg
C:\PROGRA~1\QGISES~1\apps\Python27\lib\site-packages\tornado-4.0.1-py2.7-win-amd64.egg
C:\PROGRA~1\QGISES~1\apps\Python27\lib\site-packages\backports.ssl_match_hostname-3.4.0.2-py2.7.egg
C:\PROGRA~1\QGISES~1\apps\Python27\lib\site-packages\certifi-14.05.14-py2.7.egg
C:\PROGRA~1\QGISES~1\bin\python27.zip
C:\PROGRA~1\QGISES~1\apps\Python27\DLLs
C:\PROGRA~1\QGISES~1\apps\Python27\lib
C:\PROGRA~1\QGISES~1\apps\Python27\lib\plat-win
C:\PROGRA~1\QGISES~1\apps\Python27\lib\lib-tk
C:\PROGRA~1\QGISES~1\bin
C:\PROGRA~1\QGISES~1\apps\Python27
C:\PROGRA~1\QGISES~1\apps\Python27\lib\site-packages
C:\PROGRA~1\QGISES~1\apps\Python27\lib\site-packages\PIL
C:\PROGRA~1\QGISES~1\apps\Python27\lib\site-packages\jinja2-2.7.2-py2.7.egg
C:\PROGRA~1\QGISES~1\apps\Python27\lib\site-packages\markupsafe-0.23-py2.7-win-amd64.egg
C:\PROGRA~1\QGISES~1\apps\Python27\lib\site-packages\pytz-2012j-py2.7.egg
C:\PROGRA~1\QGISES~1\apps\Python27\lib\site-packages\win32
C:\PROGRA~1\QGISES~1\apps\Python27\lib\site-packages\win32\lib
C:\PROGRA~1\QGISES~1\apps\Python27\lib\site-packages\Pythonwin
C:\PROGRA~1\QGISES~1\apps\Python27\lib\site-packages\Shapely-1.2.18-py2.7-win-amd64.egg
C:\PROGRA~1\QGISES~1\apps\Python27\lib\site-packages\wx-2.8-msw-unicode
C:\PROGRA~1\QGISES~1\apps\Python27\lib\site-packages\xlrd-0.9.2-py2.7.egg
C:\PROGRA~1\QGISES~1\apps\Python27\lib\site-packages\xlwt-0.7.5-py2.7.egg
C:/Users/goodwin/.qgis2//python
C:\PROGRA~1\QGISES~1\apps\qgis\python\plugins\fTools\tools
C:/Users/goodwin

I am getting this error when moving from the map screen to the print composer. I am using QGIS version 2.14.3-Essen on Windows 10. After I get this error, the software starts running very slowly with frequent 'not responding' status.

closed as off-topic by PolyGeo Jul 1 '16 at 20:18

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions seeking help to debug/write/improve code must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Providing a clear problem statement and evidence of a code attempt will help others to help you. See: How to create a Minimal, Complete, and Verifiable example." – PolyGeo
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    Welcome to GIS S.E., please provide the script of your code in your question. – whyzar Jul 1 '16 at 15:56
  • Just based on the error log that you posted I would suggest looking at line 170 in your code. "C:/Users/goodwin/.qgis2/python/plugins\openlayers_plugin\openlayers_layer.py", line 170, in setup_map qgisRes = rendererContext.extent().width() / self.targetSize.width() – Zachary Jul 1 '16 at 19:03

Browse other questions tagged or ask your own question.