forked from pylayers/pylayers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
INSTALL
155 lines (103 loc) · 5.31 KB
/
INSTALL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
################################
# LINUX/OSX Install #
################################
The prefer way to install pylayers is to first install the free python distribution Anaconda on your
platform. ( https://store.continuum.io/cshop/anaconda/ )
By doing so, you're installing most of the required dependencies.
1 - Download Anaconda from https://store.continuum.io/cshop/anaconda/
2 - Install Anaconda with the given command ( $bash Anaconda-<version>-<plateform>.sh ) .
Important : Say yes to add Anaconda to your path
3 - Run "./installer_unix" file from the pylayers directory (YOUR FIRST NEED to add exe rights using the command: chmod +x ./installer_unix )
4 - Set environement Variables :
It is then required to define the two enviroment variables PYLAYERS and BASENAME
On linux platforms, in your .bashrc add those 2 lines
export PYLAYERS=<path to the directory where pylayers is located>
export BASENAME=<path to a directory where you want to host your projects>
Note : The PYLAYERS environement variable MUST be set in the directory conatining the setup.py
5- Done
############################
# Windows Install #
############################
1 - Download and Install Anaconda from https://store.continuum.io/cshop/anaconda/
2 - Download the Shapely package corresponding to your platform from http://www.lfd.uci.edu/~gohlke/pythonlibs/#shapely *
3 - Download the Basemap package corresponding to your platform fromhttp://www.lfd.uci.edu/~gohlke/pythonlibs/#basemap
4 - Install Shapely and Basemap using the downloaded file
5 - Run installer.bat
6 - Set environement Variables :
Procedure for WinXP : http://support.microsoft.com/kb/310519/fr-fr
Procedure for Vista/windows 7: Start -> Right click on computer -> Properties -> Advanced system parameters -> Environement variables
PYLAYERS=<path to the directory where pylayers is located>
BASENAME=<path to a directory where you want to host your projects>
* Despite shapely is part of the Anaconda distribution, the Windows distibution doesn't contains the libgeos depencies.
#################################
# Usual install issues #
#################################
Most of the issue encountered during the install is due to
1- Multiple python installations
and/or 2- Multiple installation of some packages ( especially shapely/basemap under windows)
1- Often, multiple python installation co-exists on a same computer, and this can cause complex PyLayers installation issues. To avoid that kind of issue, please,, make sure that you're using the python installation provided by Anaconda ,and not another one.
To this end, you can check this on unix platform with :
$ which python
and under windows by opening 'cmd' and using :
c:\ for %i in (python.exe) do @echo. %~$PATH:i
If the answer doesn't point to the Anaconda installation directory, you're using the wrong python version.
You have to update the default python installation. I cannot describe here the detail procedure because it
is really depend to your configuration.
2- Another source of issues comes from some package conflicts.
This is especially the case by using a WINDOWS OS, when the shaeply installation has to be perfomed by using an external installer and not the one provided by Anaconda (because it does not contains required dependencies).
If after the installation, the import of a PyLayers module cause an Error involving shapely and/or basemap, you're probably facing the package conflict issue.
The easiest way to solve it is to remove the '.egg' of the incriminated package in :
$ <Path to Anaconda>/lib/python2.7/site-packages/ (UNIX)
or
c:\<Path to Anaconda>\Lib\site-packages (Windows)
Dependencies
------------
The following modules are required to use pylayers
numpy>=1.6.1
scipy>=0.10.1
networkx>=1.7
matplotlib>=1.1.0
shapely>=1.2.14
descartes>=1.0
SimPy>=2.2
PIL>=1.1.5
bitstring>=3.0.2
pyintervall>=1.0
osmapi>=0.3
imposm
basemap>=1.0
pandas >=0.12.0
mayavi >=4.3.1
Example of installation procedure for ubuntu 12.04 (DEPRECATED)
---------------------------------------------------------------
The installation of matplotlib basemap requires installation of libraries GEOS
and PROJ4. The installation procedure is well described in
http://matplotlib.org/basemap/users/installing.html
For supporting the osm format PyLayers is relying on imposm. The installation
of imposm is not straighforward it requires to install first Tokyo-Cabinet
and Google-Protobuf library. PyLayers can work without imposm you need to
comment the only import to the module in pylayers/gis/osmparser.py.
http://imposm.org/docs/imposm/latest/install.html#id1
This sequence of command works on a ubuntu 12.04
> sudo apt-get install build-essential
> sudo apt-get install libgeos-c1
> sudo apt-get install protobuf-compiler
> sudo apt-get install libprotobuf-dev
> sudo apt-get install libtokyocabinet-dev
> sudo apt-get install libpq-dev
> sudo apt-get install python-dev
> pip install simpy
> pip install shapely
> pip install imposm
> conda install gdal
Most of this dependencies are handled in the setup.py script.
python setup.py install
Installing PyInterval
sudo easy_install pyinterval
get crlibm library first
http://lipforge.ens-lyon.fr/frs/?group_id=8&release_id=123
if problem for compilation add
CPPFLAGS= -fPIC in scs_lib/Makefile
Testing
-------
make test-code