mapnik / mapnik

Mapnik is an open source toolkit for developing mapping applications

Home Page:http://mapnik.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AttributeError: module 'mapnik' has no attribute 'Projection'

mark-schumann opened this issue · comments

Hello Support Team at GitHub:
I recently downloaded mapnik-v3.1.0 from GitHub, and opened it with
a trial version of WinZip. My goal is to download a map into a png-file
using a Python script, something like...
nik4.py --url http://www.openstreetmap.org/#map=16/55.9865/37.2160 osm.xml screenshot.png

I am trying to run a program, nik4.py -h, in my Windows 10 system to
check my setup, as follows...

C:\Users\marks>py C:\Users\marks\AppData\Local\Programs\Python\Python39\Scripts\nik4.py -h
Traceback (most recent call last):
File "C:\Users\marks\AppData\Local\Programs\Python\Python39\Scripts\nik4.py", line 31, in
proj_lonlat = mapnik.Projection(EPSG_4326)
AttributeError: module 'mapnik' has no attribute 'Projection'

C:\Users\marks>

Through a search on "projection" from my Python subdirectory, I have
three files in the general path
C:\Users\marks\AppData\Local\Programs\Python\Python39
Scripts\mapnik...
...\test\unit\projection\proj_transform.cpp ,
...\src\projection.cpp and
...\include\mapnik\projection.hpp
(All three modules have a date-time stamp 1-8-21 5:23 AM.)

I set my environment variables as follows...
C:\Users\marks>path
PATH=C:\Program Files (x86)\Distinct\IntelliTerm;C:\Program Files\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files\nodejs;C:\Program Files\PuTTY;C:\Program Files\Git\cmd;C:\Program Files\dotnet;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\DockerDesktop\version-bin;C:\Users\marks\AppData\Local\Programs\Python\Python39;C:\Users\marks\AppData\Local\Programs\Python\Python39\Scripts;C:\Users\marks\AppData\Local\Programs\Python\Python39\Scripts\mapnik;C:\Users\marks\AppData\Local\Programs\Python\Python39\Scripts\mapnik\src;C:\Users\marks\AppData\Local\Microsoft\WindowsApps;C:\Users\marks\AppData\Roaming\npm;C:\Users\marks\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\marks\AppData\Local\Programs\Python\Python39;C:\Users\marks\AppData\Local\Programs\Python\Python39\Scripts;C:\Users\marks\AppData\Local\Programs\Python\Python39\Scripts\mapnik;C:\Users\marks\AppData\Local\Programs\Python\Python39\Scripts\mapnik\src;

Can you help me to fix this issue?

Although I don't know if a fix here will raise more issues because
at first. I had an error on import mapnik, which I fixed my renaming my
file "mapnik-v3.1.0" to "mapnik."

If you need more information, please let me know.
Thank very much.
Regards,
Mark Schumann.