Python error message that can appear when using GIS Python libraries

An example of a TypeError is:

TypeError: cannot concatenate 'str' and 'int' objects

which you receive from a piece of code like:

length = 2
units = "m"
lengthWithUnits = length + units

A quick fix would be:

length = 2
units = "m"
lengthWithUnits = str(length) + units

You are now concatenating two strings

history | excerpt history