我在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
相关信息:
问题:
有人知道是什么引起的吗?提前谢谢!在
事实证明,这个问题的根源是相当普遍的。找不到libmapnik共享库。
当我试图从python控制台导入mapnik时,收到以下错误:
这让我找到了答案: https://github.com/mapnik/mapnik/wiki/InstallationTroubleshooting#the-libmapnik-shared-library-is-not-found
解决方案: 将'/usr/local/lib'添加到'/etc/ld.conf销售订单'并运行ldconfig。在
…保持了2018年8月22日的流量,Mapnik 3和TileStache,但得到了几乎相同的错误。接受的答案对我没有帮助,而且在最近的版本中Mapnik Python bindings are installed separately。在
查看here,我可以从命令行运行,只需:
这样我就可以运行python解释器并导入mapnik。在
一个潜在的警告。Mapnik新闻页面提到pip安装使用了“pythonwheels”,如果您检查链接的页面,就会提到需要pip>;=1.4。您可以在命令行中使用
pip version
检查Pip,我的是pip7.1.2。所以大多数人都不关心这个问题。在相关问题 更多 >
编程相关推荐