python-mapnik
python-mapnik copied to clipboard
python bindings syntax error
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?
perhaps you are running python3, but print mapnik.__file__ is for python2. Try python -c "import mapnik;print(mapnik.__file__)"