2

I've install mapnik by this tutorial https://github.com/mapnik/mapnik/wiki/WindowsInstallation . I think installation over succeed becouse test on 6. step have not errors.

Next I procceed by this tutorial: http://www.bostongis.com/PrinterFriendly.aspx?content_name=generating_osm_tiles

and I try this command : python generate_xml.py osm.xml my_osm.xml --dbname=postgis --user postgres --port 5432 --extent 2430885.23, 6221979.54,2452356.05, 6243283.96 --accept-none

with this error: Error: saving xml requires Mapnik python bindings to be installed

So I google python bindings and found this: https://github.com/mapnik/python-mapnik and install it pip install mapnik Collecting mapnik Downloading mapnik-0.1-cp27-none-any.whl (37.4MB) 100% |################################| 37.4MB 30kB/s Installing collected packages: mapnik Successfully installed mapnik-0.1

and next command python setup.py install

with error:

Traceback (most recent call last):
  File "setup.py", line 87, in <module>
    ' +', ' ', cflags.replace('-g ', '').replace('-Os', '').replace('-arch i386', ''))
AttributeError: 'NoneType' object has no attribute 'replace'`

here is setup.py: http://pastebin.com/LZiGQTmz

I install mapnik 2.2 and python 2.7, and OS windows. Any ideas please?

Denis Stephanov
  • 4,563
  • 24
  • 78
  • 174
  • Did you setup your environments like here : https://gist.github.com/springmeyer/5651701 – iFlo Feb 03 '17 at 12:41
  • Yes, I did, but still not work – Denis Stephanov Feb 03 '17 at 12:47
  • Mapnik offers you the possibility of installing it without compilling in my link, you should consider doing that. – iFlo Feb 03 '17 at 12:55
  • `cflags` seems to be of type `None` because there is no `CFLAGS` environment variable. I have no idea why this script insists on having this variable. As a workaround you can try commenting these lines out. The same may apply for other variables such as `OPT`, `LDSHARED` and so on. – scai Feb 03 '17 at 13:32
  • ok, I try comment it and still not works :/ – Denis Stephanov Feb 03 '17 at 20:43

1 Answers1

0

I wouldn't expect open source projects to support Windows. I don't want to buy server licenses either.

I chose Vagrant and have no trouble following the portion of instructions concerning mapnik contained in tile-server-ubuntu. There are other ways, my raspberry pi was my first "win" but the least reproducible.

For posterity this is the code I used:

Vagrantfile:

Vagrant.configure("2") do |config|
  config.vm.box = "ubuntu/bionic64"
end

Shell commands:

sudo apt-get update
sudo apt-get -y install ca-certificates gnupg curl unzip gdal-bin tar wget bzip2 build-essential clang
#sudo apt-get install -y git  # git was already found
sudo apt-get install -y git autoconf libtool libxml2-dev libbz2-dev \
  libgeos-dev libgeos++-dev libproj-dev gdal-bin libgdal-dev g++ \
  libmapnik-dev mapnik-utils python-mapnik

shell test results:

vagrant@ubuntu-bionic:~$ mapnik-config -v
3.0.19
vagrant@ubuntu-bionic:~$ mapnik-config --input-plugins
/usr/lib/mapnik/3.0/input
vagrant@ubuntu-bionic:~$ python -c "import mapnik;print mapnik.__file__"
/usr/lib/python2.7/dist-packages/mapnik/__init__.pyc
John
  • 6,433
  • 7
  • 47
  • 82