mapnik / python-mapnik

Python bindings for mapnik
GNU Lesser General Public License v2.1
160 stars 91 forks source link

python bindings syntax error #240

Open sarpsarpp opened 3 years ago

sarpsarpp commented 3 years ago

hi, i'm trying to install python bindings to mapnik 3.1.0 on mac os big sur 11.2.2. I didn't understand how to use https://github.com/mapnik/python-mapnik.

i follow the instructions on https://github.com/mapnik/mapnik/wiki/GettingStartedInPython and cannot come clear the second line of the step 1. i get this error:

$ python -c "import mapnik;print mapnik.__file__" File "<string>", line 1 import mapnik;print mapnik.__file__ ^ SyntaxError: invalid syntax

can you please help?

mpuchko commented 3 years ago

perhaps you are running python3, but print mapnik.__file__ is for python2. Try python -c "import mapnik;print(mapnik.__file__)"