Thanks for your help Dane,

Ah I see Cairo is there. Appologies, I think I got confused somewhere.
Removed the macport install now : )

'/Library/Frameworks/Mapnik.framework/Versions/Current/Python/System/ 2.5/site-packages/mapnik/__init__.py'

What is really confusing me is that the package I installed from the following "installing Mapnik" instructions..

"If you haven't already done so, export the Mapnik stuff from the OSM subversion repository:

svn export http://svn.openstreetmap.org/applications/rendering/mapnik
cd mapnik"

Is here.
/usr/local/Cellar/mapnik/

So currently this is where I edit the xml files, keep the shape files etc.

But as far as I can make out I only have the one Unix Executable and thats in the framework. If I move it, I can no longer use Mapnik.

So Mapnik seems to be running fine.

But when I try to import Cairo I get this error.

>>> import mapnik
>>> import cairo
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/Cellar/mapnik/cairo.py", line 19, in <module>
surface = cairo.SVGSurface(file.name, mapnik_map.width, mapnik_map.height)
AttributeError: 'module' object has no attribute 'SVGSurface'
>>>

However if I start python from home$

No problem.
Type "help", "copyright", "credits" or "license" for more information.
>>> import cairo
>>>


Basically I think I have misunderstood where the Mapnik folder with xml files should be kept.

Any help would be much appreciated.

Many thanks

Simon








to see where your mapnik is coming from. I recommend only installing mapnik and cairo from one source, and the binary installer above should work on a vanilla osx system without homebrew or macports. I recommend uninstalling all things that you installed with those package managers relating to Mapnik and Cairo. If the binary installer did not work alone, post why.

I wanted to give Cairo a try so I followed the Mapnik instructions through Macports and now
that lives here

/opt etc.

When I run the Mapnik svg example script I get this error.

File "./cairo.py", line 8, in <module>
  import cairo
File "/usr/local/Cellar/mapnik/cairo.py", line 19, in <module>
surface = cairo.SVGSurface(file.name, mapnik_map.width, mapnik_map.height)
AttributeError: 'module' object has no attribute 'SVGSurface'

So I guess Mapnik is not finding the Cairo files.

Any ideas what I can do to get my Mapnik files to find them?

Would some sort of symbolic link do it or do I need to try and reinstall Mapnik ?

Thanks for your help

Simon



_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users


_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users

Reply via email to