Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'NoneType' #19

Open
shapley opened this issue Feb 22, 2021 · 4 comments
Open

AttributeError: 'NoneType' #19

shapley opened this issue Feb 22, 2021 · 4 comments

Comments

@shapley
Copy link

shapley commented Feb 22, 2021

Hi,

Been using the gisquick plugin and all has worked well but when I created a new QGIS project recently when I clicked on the 'gisquick plugin' then moving from 'Base layer' > 'next' the following error appears:-

An error has occurred while executing Python code:

AttributeError: 'NoneType' object has no attribute 'mapUnitsToLayoutUnits'
Traceback (most recent call last):
File "/home/paul/.var/app/org.qgis.qgis/data/QGIS/QGIS3/profiles/default/python/plugins/gisquick-qgis-plugin/project.py", line 291, in validate
self.get_metadata()
File "/home/paul/.var/app/org.qgis.qgis/data/QGIS/QGIS3/profiles/default/python/plugins/gisquick-qgis-plugin/project.py", line 1133, in get_metadata
units_conversion = map.mapUnitsToLayoutUnits()
AttributeError: 'NoneType' object has no attribute 'mapUnitsToLayoutUnits'

Python version: 3.7.4 (default, Nov 10 2011, 15:00:00) [GCC 9.2.0]
QGIS version: 3.12.3-București București, 82342615

Python Path:
/app/share/qgis/python
/home/paul/.var/app/org.qgis.qgis/data/QGIS/QGIS3/profiles/default/python
/home/paul/.var/app/org.qgis.qgis/data/QGIS/QGIS3/profiles/default/python/plugins
/app/share/qgis/python/plugins
/usr/lib/python37.zip
/usr/lib/python3.7
/usr/lib/python3.7/lib-dynload
/usr/lib/python3.7/site-packages
/app/lib/python3.7/site-packages
/app/lib/python3.7/site-packages/numpy-1.14.3-py3.7-linux-x86_64.egg
/app/lib/python3.7/site-packages/MarkupSafe-1.0-py3.7-linux-x86_64.egg
/home/paul/.var/app/org.qgis.qgis/data/QGIS/QGIS3/profiles/default/python
/home/paul/Desktop/My Desktop Stuff/gisquick

No idea why it won't now work on any project anymore. I'm using QGIS 3.12.3 on Ubuntu 20.04 LTS 64 bit.

Many thanks,

@marcel-dancak
Copy link

Hi,
from this traceback it looks like you have a print layout in your project, but without a map element. And right now, plugin doesn't expect such situation. If there is a valid use case for such layouts, then plugin could ignore them, but right now I'm not sure. I will let this issue opened for further discussion.

@shapley
Copy link
Author

shapley commented Feb 24, 2021 via email

@shapley
Copy link
Author

shapley commented Feb 24, 2021

I can confirm that there is no missing map element. I've tried some variations such as removing all layers and adding them back in one-by-one, nothing is allowing me to move from this error even re-installed the plugin. I would like this to work. How do i go about getting some development time for it to work?

Python Error:

2021-02-24T14:16:02 WARNING Traceback (most recent call last):
File "/home/paul/.local/share/QGIS/QGIS3/profiles/default/python/plugins/gisquick-qgis-plugin/project.py", line 291, in validate
self.get_metadata()
File "/home/paul/.local/share/QGIS/QGIS3/profiles/default/python/plugins/gisquick-qgis-plugin/project.py", line 1133, in get_metadata
units_conversion = map.mapUnitsToLayoutUnits()
AttributeError: 'NoneType' object has no attribute 'mapUnitsToLayoutUnits'

@marcel-dancak
Copy link

It doesn't look like problem with layers, but with print layouts in your project. If you open your project in QGIS, you can try to run this code in Python Console (Plugins menu) to get more info.

project = QgsProject.instance()
pm = project.layoutManager()
[[layout.name(), layout.referenceMap()] for layout in pm.layouts()]

@landam landam transferred this issue from gisquick/gisquick Jun 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants