python-mapnik icon indicating copy to clipboard operation
python-mapnik copied to clipboard

python bindings syntax error

Open sarpsarpp opened this issue 4 years ago • 1 comments

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?

sarpsarpp avatar Apr 08 '21 09:04 sarpsarpp

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

mpuchko avatar Apr 26 '21 13:04 mpuchko