windows环境下安装Python的Rtree包

Rtree包是基于libspatialindex开发的,在安装Rtree之前必须先安装libspatialindex。关于libspatialindex,除了官网的英文外,这里有一个中文翻译过来的介绍:http://blog.csdn.net/ljz2173/article/details/46009573,不再多说。

1. 这里 http://www.lfd.uci.edu/~gohlke/pythonlibs/#rtree 下载对应版本的Rtree的whl安装包,注意是python2.7还是3.5,注意电脑是32还是64位。可以放在电脑任意位置

2. 确保电脑里已经安装了python中wheel这个包,没有的话这个可以直接在cmd中输入pip install wheel安装

3. 打开cmd,输入pip install E:\软件安装包\Rtree-0.8.2-cp35-cp35m-win_amd64.whl,这个E盘是我存放Rtree的whl安装包的位置,自己安装的时候根据具体情况改一下即可。

windows环境下安装Python的Rtree包_第1张图片

顺便啰嗦一句吧,Linux安装libspatialindex的步骤大概如下:

https://github.com/libspatialindex/libspatialindex/wiki/1.-Getting-Started

鉴于国内github可能被墙,顺便也贴过来吧:

 

This tutorial will help you to get started with libspatialindex using C++ on linux. The following code is run on Ubuntu 12. If you are using windows the installation may be different. First install some prerequisites please enter the following into terminal. You may very well already have these installed.

windows环境下安装Python的Rtree包_第2张图片

Now we download and install the library. It doesn't matter what directory you download this in. Please note the version number, you can check if there are more recent versions in the download page here http://download.osgeo.org/libspatialindex/ . Now enter the following into your terminal:

windows环境下安装Python的Rtree包_第3张图片

libspatialindex should now be installed on your system. Let's try to make a small c++ program to test this. Create the file tutorial1.cpp somewhere and enter the following:

windows环境下安装Python的Rtree包_第4张图片

Now let's compile the code. Type the following into the console. Please note -std=c++0x makes it compile into C++11, although not required here it will be used in later examples.

Now run the program:

windows环境下安装Python的Rtree包_第5张图片

and it should output the following:

 

 

 
   

 

转载于:https://www.cnblogs.com/xuzijie/p/9680581.html

你可能感兴趣的:(python,c/c++)