简体   繁体   English

Mapnik安装:CentOS

[英]Mapnik Install: CentOS

The problem: 问题:

I've installed mapnik 3.0.1 successfully by running the typical source code install: 通过运行典型的源代码安装,我已经成功安装了mapnik 3.0.1:

./configure
make && make install
ldconfig -v

However.... 然而....

When I import mapnik into python I get the following: 当我将mapnik导入python时,得到以下信息:

Python 2.7.5 (default, Jun 24 2015, 00:41:19) 
[GCC 4.8.3 20140911 (Red Hat 4.8.3-9)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import mapnik
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named mapnik
>>> 

I've tried everything recommended on Mapnik's Troubleshooting page by linking library paths , editing ld.so.conf , etc... 我通过链接库路径 ,编辑ld.so.conf等,尝试了Mapnik的“疑难解答”页面上推荐的所有内容。

I've been trying to figure this out all day, which isn't very productive. 我一直试图解决这一问题,但效率不高。 I've tried building other versions of mapnik, and the same thing happens. 我尝试构建其他版本的mapnik,并且发生了同样的事情。 How do I get this imported??? 我该如何导入呢???

Thanks in advance. 提前致谢。

Yea, you need the python bindings, which is a separate thing. 是的,您需要python绑定,这是另一回事。 As you mentioned they are actually included with mapnik 3.0 but you still haven't registered them (python doesn't know where they are). 如您所述,它们实际上已包含在mapnik 3.0中,但您尚未注册它们(python不知道它们在哪里)。 This is the easiest way I've found below: 这是我在下面找到的最简单的方法:

Install mapnik : 安装mapnik

brew install mapnik

Verify mapnik is installed (should be 3.0 now) 确认已安装mapnik(现在应为3.0)

mapnik-config -v

Install mapnik python bindings (see here https://github.com/mapnik/python-mapnik ): 安装mapnik python绑定 (请参阅此处https://github.com/mapnik/python-mapnik ):

git clone git@github.com:mapnik/python-mapnik.git
cd python-mapnik
python setup.py install

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM