我在Redhat上安装了一个TileStache服务器,从源代码安装Mapnik2.2。但是,Tilestache给了我以下错误:
Traceback (most recent call last):
File "/usr/lib64/python2.6/site-packages/gevent/pywsgi.py", line 508, in handle_one_response
self.run_application()
File "/usr/lib64/python2.6/site-packages/gevent/pywsgi.py", line 494, in run_application
self.result = self.application(self.environ, self.start_response)
File "/usr/lib/python2.6/site-packages/TileStache/__init__.py", line 381, in __call__
status_code, headers, content = requestHandler2(self.config, path_info, query_string, script_name)
File "/usr/lib/python2.6/site-packages/TileStache/__init__.py", line 254, in requestHandler2
status_code, headers, content = layer.getTileResponse(coord, extension)
File "/usr/lib/python2.6/site-packages/TileStache/Core.py", line 414, in getTileResponse
tile = self.render(coord, format)
File "/usr/lib/python2.6/site-packages/TileStache/Core.py", line 500, in render
tile = provider.renderTile(width, height, srs, coord)
File "/usr/lib/python2.6/site-packages/TileStache/Goodies/Providers/MapnikGrid.py", line 72, in renderTile
self.mapnik = mapnik.Map(0, 0)
NameError: global name 'mapnik' is not defined相关信息:
问题:
有人知道是什么导致了这一切吗?提前感谢!
发布于 2014-08-22 19:00:11
事实证明,这个问题的根源是相当普遍的。没有找到libmapnik共享库。
当我试图从python控制台导入mapnik时,我收到了以下错误:
>>> import mapnik
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib64/python2.6/site-packages/mapnik/__init__.py", line 69, in <module>
from _mapnik import *
ImportError: libmapnik.so.2.2: cannot open shared object file: No such file or directory 解决方案:将'/usr/local/lib‘添加到'/etc/ld.so.conf’并运行ldconfig。
发布于 2018-08-22 18:31:54
...keeping在2018年8月22日的流量与Mapnik 3和TileStache,但得到了一个几乎相同的错误。接受的答案对我没有帮助,而且在最近的版本中证明了Mapnik Python绑定分别安装。。
在查看这里时,我可以从命令行运行,只需:
pip install mapnik这样我就可以运行python解释器并导入mapnik。
一个潜在的警告。这个Mapnik新闻页面提到了pip安装使用了“Python轮”,如果您检查链接的页面,就会提到您需要pip >= 1.4。您可以在命令行上使用pip --version检查Pip,而我的则是pip7.1.2。所以,对大多数人来说,这很可能是不重要的。
https://stackoverflow.com/questions/25450026
复制相似问题