Project Installation

Version 271 (Etienne Pallier, 05/29/2017 09:33 am)

1 1 Etienne Pallier
h1. Project Installation
2 1 Etienne Pallier
3 6 Etienne Pallier
4 270 Etienne Pallier
This page describes the installation phase of the Pyros software.
5 1 Etienne Pallier
6 271 Etienne Pallier
If you want access to the ETC-VC-IS software, [[go to this page]]
7 271 Etienne Pallier
8 271 Etienne Pallier
(https://gitlab.irap.omp.eu/gft/gft-sim)
9 189 Etienne Pallier
10 11 Etienne Pallier
Project Development page : [[Project Development]]
11 11 Etienne Pallier
12 6 Etienne Pallier
HOWTO Format Redmine Wiki : http://www.redmine.org/projects/redmine/wiki/FrRedmineWikiFormatting
13 6 Etienne Pallier
14 193 Etienne Pallier
{{toc}}
15 6 Etienne Pallier
16 6 Etienne Pallier
17 3 Etienne Pallier
---
18 3 Etienne Pallier
19 170 Etienne Pallier
---
20 170 Etienne Pallier
21 221 Etienne Pallier
h2. %{margin-left:0px; font-weight:bold; font-size:25px;  display:block; color:red;}DATABASE SCHEMA (v0.2.2)%
22 4 Etienne Pallier
23 4 Etienne Pallier
24 222 Etienne Pallier
{{thumbnail(PYROS_DBM_V0_2_2.png, size=2000, title=Pyros data model)}}
25 4 Etienne Pallier
26 4 Etienne Pallier
27 4 Etienne Pallier
---
28 5 Etienne Pallier
29 170 Etienne Pallier
---
30 170 Etienne Pallier
31 226 Etienne Pallier
h2. %{margin-left:0px; font-weight:bold; font-size:25px;  display:block; color:red;}COMPATIBLE PLATFORMS (TESTED)%
32 226 Etienne Pallier
33 253 Jeremy Barneron
This software is targetted first for Linux CentOS 7 (+ Fedora and Ubuntu), but also for Mac OS X and Windows.
34 231 Etienne Pallier
All these systems should run Python 3 (3.5+)
35 226 Etienne Pallier
36 227 Etienne Pallier
Pyros has been tested on these platforms:
37 226 Etienne Pallier
38 232 Etienne Pallier
* CentOS 7.1 (with Python 3.4)
39 235 Paul Carensac
* Linux Mint 17.2 ( == Ubuntu 14.04.3) (with Python 3.5)
40 254 Jeremy Barneron
* Ubuntu 16.04 (with python 3.5.2)
41 232 Etienne Pallier
* Mac OS 10.11.6 (with Python 3.5)
42 232 Etienne Pallier
* Windows 10 (with Python 3.5)
43 226 Etienne Pallier
44 177 Etienne Pallier
h2. %{margin-left:0px; font-weight:bold; font-size:25px;  display:block; color:red;}I - PREREQUISITES%
45 177 Etienne Pallier
46 181 Paul Carensac
Pyros needs some prerequisites : 
47 177 Etienne Pallier
48 229 Etienne Pallier
* Python 3.5+
49 181 Paul Carensac
* RabbitMQ
50 220 Etienne Pallier
* [optional] a Mysql Database server (but you can use Sqlite instead, with no installation)
51 177 Etienne Pallier
52 177 Etienne Pallier
53 177 Etienne Pallier
---
54 177 Etienne Pallier
55 255 Jeremy Barneron
h3. Install Python3 (3.5+) + pip + virtualenv
56 177 Etienne Pallier
57 177 Etienne Pallier
_If Python 3 is already installed on your computer, skip this section_
58 177 Etienne Pallier
59 177 Etienne Pallier
60 177 Etienne Pallier
 * Linux (CentOS 7.1, main target): (python35 not yet available as rpm)
61 177 Etienne Pallier
<pre>
62 177 Etienne Pallier
$ sudo yum update yum
63 177 Etienne Pallier
$ sudo yum update kernel
64 177 Etienne Pallier
$ sudo yum update
65 1 Etienne Pallier
66 1 Etienne Pallier
$ sudo yum install python34
67 1 Etienne Pallier
$ python3.4 -V
68 1 Etienne Pallier
Python 3.4.3
69 1 Etienne Pallier
70 1 Etienne Pallier
$ sudo yum install python34-devel
71 1 Etienne Pallier
(needed for python package mysqlclient)
72 1 Etienne Pallier
73 1 Etienne Pallier
$ sudo yum update python-setuptools
74 264 Etienne Pallier
$ easy_install --version 
75 1 Etienne Pallier
setuptools 0.9.8
76 1 Etienne Pallier
$ sudo easy_install pip
77 1 Etienne Pallier
$ pip --version
78 1 Etienne Pallier
pip 8.1.1 from /usr/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg (python 2.7)
79 1 Etienne Pallier
80 264 Etienne Pallier
$ sudo pip install --upgrade pip
81 264 Etienne Pallier
$ sudo pip install --upgrade virtualenv
82 1 Etienne Pallier
$ virtualenv --version
83 1 Etienne Pallier
15.0.1
84 1 Etienne Pallier
85 1 Etienne Pallier
Necessary for "lxml" python package:
86 1 Etienne Pallier
$ sudo yum install libxml2 libxml2-devel
87 1 Etienne Pallier
$ sudo yum install libxslt libxslt-devel
88 1 Etienne Pallier
89 1 Etienne Pallier
</pre>
90 1 Etienne Pallier
91 1 Etienne Pallier
92 1 Etienne Pallier
 * Linux (Ubuntu) :
93 1 Etienne Pallier
<pre>
94 1 Etienne Pallier
$ sudo add-apt-repository ppa:fkrull/deadsnakes
95 1 Etienne Pallier
$ sudo apt-get update
96 1 Etienne Pallier
$ sudo apt-get install python3.5
97 237 Jeremy Barneron
$ sudo apt-get install libxml2-dev
98 237 Jeremy Barneron
$ sudo apt-get install libxslt-dev
99 249 Jeremy Barneron
$ sudo apt-get install python-pip
100 1 Etienne Pallier
101 1 Etienne Pallier
$ sudo apt-get install python3.5-dev
102 1 Etienne Pallier
(needed for python package mysqlclient)
103 1 Etienne Pallier
104 264 Etienne Pallier
$ sudo pip install --upgrade virtualenv
105 1 Etienne Pallier
</pre>
106 1 Etienne Pallier
107 1 Etienne Pallier
108 1 Etienne Pallier
 * Mac OS X :
109 1 Etienne Pallier
110 1 Etienne Pallier
  * From binary (Mac OS native application)
111 1 Etienne Pallier
(TODO:)
112 1 Etienne Pallier
113 1 Etienne Pallier
  * From MacPort
114 1 Etienne Pallier
115 1 Etienne Pallier
   * a) install macport
116 208 Etienne Pallier
cf https://www.macports.org/install.php
117 1 Etienne Pallier
118 260 Etienne Pallier
   * b) install the "port" python36
119 1 Etienne Pallier
<pre>
120 260 Etienne Pallier
$ sudo port install python36
121 260 Etienne Pallier
$ sudo port select --set python3 python36
122 260 Etienne Pallier
$ sudo port install py36-readline
123 260 Etienne Pallier
$ sudo port install py36-pip
124 260 Etienne Pallier
$ port select --set pip pip36
125 1 Etienne Pallier
</pre>
126 1 Etienne Pallier
127 1 Etienne Pallier
128 202 Paul Carensac
 * Windows (tested with Windows 7 & 10) :
129 1 Etienne Pallier
<pre>
130 1 Etienne Pallier
Go to https://www.python.org/downloads/windows/ , choose the wanted version
131 1 Etienne Pallier
On the wanted version’s page, download Windows x86 executable installer
132 1 Etienne Pallier
133 1 Etienne Pallier
Run the executable
134 1 Etienne Pallier
    * On the first page, check "Add python3.5 to PATH"
135 1 Etienne Pallier
    * Choose "Install now" option
136 1 Etienne Pallier
137 1 Etienne Pallier
Open cmd (windows + R, cmd) :
138 1 Etienne Pallier
 $ python -m pip install --upgrade pip
139 1 Etienne Pallier
 $ pip install virtualenv
140 1 Etienne Pallier
</pre>
141 200 Paul Carensac
142 200 Paul Carensac
---
143 200 Paul Carensac
144 200 Paul Carensac
h3. Install a database server (only if necessary)
145 200 Paul Carensac
146 200 Paul Carensac
_If the MySql database server is already installed on your computer, skip this section_
147 200 Paul Carensac
148 200 Paul Carensac
By default, Pyros uses Mysql, but this implies that you have to install the Mysql database server...
149 200 Paul Carensac
150 200 Paul Carensac
Thus, to make things easier, avoid Mysql installation by using Sqlite instead as the database server (which will need no installation at all) :
151 200 Paul Carensac
152 200 Paul Carensac
=> *For this, just edit the file PYROS/src/pyros/settings.py and set MYSQL variable to False, and that's it. You can go to next section*
153 200 Paul Carensac
154 200 Paul Carensac
Now, if you really want to use Mysql (which is the default), you will need to install it (only if not already installed), so keep reading.
155 200 Paul Carensac
156 200 Paul Carensac
_(Skip this if you are using Sqlite instead of MySql)_
157 200 Paul Carensac
158 200 Paul Carensac
 * Linux Ubuntu
159 200 Paul Carensac
<pre>
160 200 Paul Carensac
First, update your system:
161 200 Paul Carensac
$ sudo apt-get update
162 200 Paul Carensac
163 200 Paul Carensac
$ sudo apt-get install mysql-server
164 200 Paul Carensac
$ sudo apt-get install mysql-client
165 200 Paul Carensac
166 200 Paul Carensac
$ sudo apt-get install libmysqlclient-dev
167 200 Paul Carensac
(needed for python package mysqlclient)
168 200 Paul Carensac
</pre>
169 200 Paul Carensac
170 200 Paul Carensac
 * Linux CentOS : cf https://www.howtoforge.com/apache_php_mysql_on_centos_7_lamp#-installing-mysql-
171 200 Paul Carensac
<pre>
172 200 Paul Carensac
First, update your system:
173 200 Paul Carensac
$ sudo yum update yum
174 200 Paul Carensac
$ sudo yum update kernel
175 200 Paul Carensac
$ sudo yum update
176 200 Paul Carensac
177 200 Paul Carensac
$ sudo yum install mariadb-server 
178 200 Paul Carensac
$ sudo yum install mariadb
179 200 Paul Carensac
180 200 Paul Carensac
$ sudo yum install mariadb-devel
181 200 Paul Carensac
(needed for python package mysqlclient)
182 200 Paul Carensac
183 200 Paul Carensac
$ sudo systemctl start mariadb.service
184 200 Paul Carensac
185 200 Paul Carensac
$ sudo systemctl enable mariadb.service
186 200 Paul Carensac
=> Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.
187 200 Paul Carensac
188 200 Paul Carensac
$ sudo mysql_secure_installation
189 200 Paul Carensac
</pre>
190 200 Paul Carensac
191 200 Paul Carensac
 * Mac OS X
192 200 Paul Carensac
Install XAMPP
193 200 Paul Carensac
(but you could also use the pre-installed Mac OS MySql, or install MySql from macport)
194 209 Etienne Pallier
cf https://www.apachefriends.org/fr/index.html
195 209 Etienne Pallier
196 200 Paul Carensac
197 201 Paul Carensac
 * Windows (tested with Windows 7 & 10)
198 200 Paul Carensac
199 200 Paul Carensac
<pre>
200 200 Paul Carensac
Download and install the newest version on https://dev.mysql.com/downloads/installer/
201 200 Paul Carensac
202 200 Paul Carensac
Once installed, launch MySQL Installer. Clic on 'Add...' on the right.
203 200 Paul Carensac
In MySQLServers section, choose the newest, then clic on next.
204 200 Paul Carensac
Install and configure the server (just follow the installation guide).
205 200 Paul Carensac
206 200 Paul Carensac
Then launch mysql (via the Windows menu).
207 200 Paul Carensac
</pre>
208 200 Paul Carensac
209 177 Etienne Pallier
210 1 Etienne Pallier
---
211 181 Paul Carensac
212 181 Paul Carensac
h3. Install RabbitMQ
213 181 Paul Carensac
214 181 Paul Carensac
RabbitMQ is a message queue server used by Celery to handle tasks queues.
215 248 Etienne Pallier
It uses the amqp protocol to manage queue messages.
216 181 Paul Carensac
217 181 Paul Carensac
 * Ubuntu (the server is automatically started) :
218 181 Paul Carensac
<pre>
219 181 Paul Carensac
$ sudo apt-get install rabbitmq-server
220 245 Etienne Pallier
221 245 Etienne Pallier
Get status:
222 245 Etienne Pallier
$ sudo invoke-rc.d rabbitmq-server status
223 245 Etienne Pallier
224 245 Etienne Pallier
Stop:
225 245 Etienne Pallier
$ sudo invoke-rc.d rabbitmq-server stop
226 245 Etienne Pallier
227 245 Etienne Pallier
Start:
228 245 Etienne Pallier
$ sudo invoke-rc.d rabbitmq-server start
229 245 Etienne Pallier
230 181 Paul Carensac
</pre>
231 245 Etienne Pallier
232 245 Etienne Pallier
233 183 Paul Carensac
234 195 Etienne Pallier
 * CentOS :
235 195 Etienne Pallier
<pre>
236 195 Etienne Pallier
$ sudo yum install rabbitmq-server
237 196 Etienne Pallier
238 196 Etienne Pallier
Installation :
239 196 Etienne Pallier
 rabbitmq-server                                                           noarch                          3.3.5-17.el7
240 196 Etienne Pallier
Installation pour dépendances :
241 196 Etienne Pallier
 erlang-asn1                                                               x86_64                          R16B-03.16.el7
242 246 Etienne Pallier
243 246 Etienne Pallier
Get status:
244 247 Etienne Pallier
(CentOS7) $ sudo rabbitmqctl status
245 247 Etienne Pallier
(older CentOS) $ sudo /sbin/service rabbitmq-server status
246 1 Etienne Pallier
247 1 Etienne Pallier
Stop:
248 247 Etienne Pallier
(CentOS7) $ sudo systemctl stop rabbitmq-server
249 247 Etienne Pallier
(older CentOS) $ sudo /sbin/service rabbitmq-server stop
250 1 Etienne Pallier
251 246 Etienne Pallier
Start:
252 247 Etienne Pallier
(CentOS7) $ sudo systemctl start rabbitmq-server
253 247 Etienne Pallier
(older CentOS) $ sudo /sbin/service rabbitmq-server start
254 195 Etienne Pallier
</pre>
255 195 Etienne Pallier
256 183 Paul Carensac
 * MacOS :
257 183 Paul Carensac
<pre>
258 194 Etienne Pallier
With MacPort:
259 194 Etienne Pallier
$ sudo port install rabbitmq-server
260 194 Etienne Pallier
--->  Installing erlang @18.2.1_1+hipe+ssl
261 194 Etienne Pallier
...
262 1 Etienne Pallier
--->  Installing rabbitmq-server @3.5.7_0
263 1 Etienne Pallier
--->  Activating rabbitmq-server @3.5.7_0
264 1 Etienne Pallier
...
265 247 Etienne Pallier
266 1 Etienne Pallier
To start rabbitmq : 
267 1 Etienne Pallier
$ sudo rabbitmq-server
268 261 Etienne Pallier
269 261 Etienne Pallier
Get status:
270 261 Etienne Pallier
$ sudo rabbitmqctl status
271 244 Etienne Pallier
272 244 Etienne Pallier
To stop rabbitmq : 
273 244 Etienne Pallier
$ sudo rabbitmqctl stop
274 240 Etienne Pallier
</pre>
275 244 Etienne Pallier
276 240 Etienne Pallier
277 240 Etienne Pallier
278 183 Paul Carensac
 * Windows :
279 191 Paul Carensac
280 191 Paul Carensac
  * Take the wanted Erlang version at http://www.erlang.org/downloads and install it (required)
281 191 Paul Carensac
  * Take the wanted RabbitMQ version at https://www.rabbitmq.com/install-windows.html and install it. Then the server will run automatically
282 191 Paul Carensac
283 191 Paul Carensac
284 177 Etienne Pallier
285 177 Etienne Pallier
---
286 177 Etienne Pallier
287 179 Etienne Pallier
h2. %{margin-left:0px; font-weight:bold; font-size:25px;  display:block; color:red;}II - GET THE PYROS SOFTWARE%
288 5 Etienne Pallier
289 125 Etienne Pallier
h3. Authenticate to https://gitlab.irap.omp.eu/epallier/pyros
290 125 Etienne Pallier
291 125 Etienne Pallier
In order to get this software, you must first authenticate on the IRAP gitlab.
292 125 Etienne Pallier
293 125 Etienne Pallier
For this, just go to https://gitlab.irap.omp.eu/epallier/pyros
294 125 Etienne Pallier
and either sign in with your LDAP account (if you are from IRAP),
295 125 Etienne Pallier
or register via the "Sign up" form.
296 5 Etienne Pallier
297 113 Etienne Pallier
h3. Software structure
298 5 Etienne Pallier
299 207 Paul Carensac
See [[Project_structure|Project Structure]] page.
300 1 Etienne Pallier
301 112 Etienne Pallier
h3. Browse the code (from gitlab)
302 111 Etienne Pallier
303 111 Etienne Pallier
https://gitlab.irap.omp.eu/epallier/pyros/tree/master
304 111 Etienne Pallier
305 203 Paul Carensac
h3. You can download it (static version, not synchronized)
306 111 Etienne Pallier
307 114 Etienne Pallier
You can download the current version of the software.
308 114 Etienne Pallier
309 115 Etienne Pallier
Go to https://gitlab.irap.omp.eu/epallier/pyros/tree/master
310 115 Etienne Pallier
311 115 Etienne Pallier
Click on "Download zip" on the up right hand corner.
312 115 Etienne Pallier
313 115 Etienne Pallier
Double-click on it to unzip it.
314 115 Etienne Pallier
315 115 Etienne Pallier
You should get a "pyros.git" folder.
316 115 Etienne Pallier
317 116 Etienne Pallier
In this documentation, this software folder will be referenced as "PYROS".
318 115 Etienne Pallier
319 118 Etienne Pallier
(you can rename "pyros.git" as "PYROS" if you want : "mv pyros.git PYROS")
320 114 Etienne Pallier
321 203 Paul Carensac
h3. (Windows developers only) : Get git for Windows
322 1 Etienne Pallier
323 203 Paul Carensac
 * Download git at https://git-scm.com/download/win
324 203 Paul Carensac
 * Run setup (keep default configurations)
325 203 Paul Carensac
 * Once installed, open cmd
326 203 Paul Carensac
<pre>
327 203 Paul Carensac
$ git config --global http.sslVerify false
328 203 Paul Carensac
</pre>
329 203 Paul Carensac
330 203 Paul Carensac
You can now use your git from the cmd or the graphic client !
331 203 Paul Carensac
332 203 Paul Carensac
h3. (Developers only) Get it from GIT (dynamic version, synchronized)
333 203 Paul Carensac
334 122 Etienne Pallier
(If you are using Windows, you must first get the git software, see below "Get git for Windows")
335 122 Etienne Pallier
336 114 Etienne Pallier
By getting the software from git, you will get a dynamically synchronized version,
337 114 Etienne Pallier
which means that you will be able to update your version as soon as a new version is available
338 114 Etienne Pallier
(with the command : "git pull").
339 111 Etienne Pallier
340 111 Etienne Pallier
* From Eclipse : See below, section "NOTES FOR ECLIPSE USERS"
341 111 Etienne Pallier
342 111 Etienne Pallier
* From the terminal
343 5 Etienne Pallier
344 5 Etienne Pallier
<pre>
345 5 Etienne Pallier
git clone https://gitlab.irap.omp.eu/epallier/pyros.git PYROS
346 1 Etienne Pallier
</pre>
347 86 Etienne Pallier
348 86 Etienne Pallier
_(or also : git clone git@gitlab.irap.omp.eu:epallier/pyros.git PYROS)_
349 5 Etienne Pallier
350 5 Etienne Pallier
If you ever get this error message :
351 1 Etienne Pallier
<pre>
352 1 Etienne Pallier
fatal: unable to access 'https://gitlab.irap.omp.eu/epallier/pyros.git/': Peer's certificate issuer has been marked as not trusted by the user.
353 122 Etienne Pallier
</pre>
354 122 Etienne Pallier
355 122 Etienne Pallier
Then, type this command (and then run again the git clone command):
356 121 Paul Carensac
<pre>
357 121 Paul Carensac
$ git config --global http.sslVerify false
358 121 Paul Carensac
</pre>
359 121 Paul Carensac
360 1 Etienne Pallier
(Also, the first time you get the project, it will ask you for a login and password)
361 121 Paul Carensac
362 168 Etienne Pallier
This creates a PYROS/ folder containing the project (with a .git/ subfolder for synchronization with the git repository)
363 168 Etienne Pallier
364 168 Etienne Pallier
365 169 Etienne Pallier
366 169 Etienne Pallier
367 169 Etienne Pallier
---
368 169 Etienne Pallier
369 169 Etienne Pallier
---
370 169 Etienne Pallier
371 186 Paul Carensac
h2. %{margin-left:0px; font-weight:bold; font-size:25px;  display:block; color:red;}III - INSTALLATION OF NEEDED PROJECT DEPENDENCIES%
372 166 Etienne Pallier
373 186 Paul Carensac
---
374 186 Paul Carensac
375 186 Paul Carensac
h3. Install Comet
376 186 Paul Carensac
377 214 Etienne Pallier
Comet is needed as a broker to receive and send VOEvents (https://github.com/jdswinbank/Comet/tree/py3)
378 213 Etienne Pallier
*You MUST have your virtualenv activated (source venv_py3_pyros/bin/activate in your 'private/' directory)*
379 1 Etienne Pallier
Documentation is available here : http://comet.readthedocs.io/en/stable/installation.html
380 213 Etienne Pallier
(see also http://voevent.readthedocs.io/en/latest/setup.html)
381 186 Paul Carensac
382 212 Etienne Pallier
* Ubuntu :
383 186 Paul Carensac
384 186 Paul Carensac
<pre>
385 186 Paul Carensac
# You can do this anywhere on your computer
386 1 Etienne Pallier
$ git clone https://github.com/jdswinbank/Comet.git
387 1 Etienne Pallier
$ cd Comet
388 1 Etienne Pallier
$ (sudo ?) python setup.py install
389 236 Jeremy Barneron
$ sudo apt-get install python-lxml
390 1 Etienne Pallier
391 1 Etienne Pallier
# Now you can test it, no failure are expected, please contact the dev team for help
392 213 Etienne Pallier
$ twistd comet --help
393 1 Etienne Pallier
$ trial comet
394 213 Etienne Pallier
All tests should pass
395 1 Etienne Pallier
</pre>
396 1 Etienne Pallier
397 212 Etienne Pallier
398 1 Etienne Pallier
* MacOS :
399 1 Etienne Pallier
<pre>
400 213 Etienne Pallier
Idem Ubuntu
401 1 Etienne Pallier
</pre>
402 1 Etienne Pallier
403 212 Etienne Pallier
* Windows :
404 1 Etienne Pallier
<pre>
405 212 Etienne Pallier
TODO:
406 212 Etienne Pallier
</pre>
407 212 Etienne Pallier
408 212 Etienne Pallier
409 212 Etienne Pallier
410 212 Etienne Pallier
411 212 Etienne Pallier
412 190 Paul Carensac
413 190 Paul Carensac
---
414 190 Paul Carensac
415 211 Etienne Pallier
h3. Install the other project dependencies and the database (within a Python virtual environment)
416 190 Paul Carensac
417 267 Etienne Pallier
---
418 265 Etienne Pallier
419 268 Etienne Pallier
*TODO:
420 265 Etienne Pallier
eviter l'installation de virtualenv car ca oblige a executer le script install.py avec sudo !!!*
421 265 Etienne Pallier
=> en faire plutot un pré-requis (comme python3 et mysql).
422 1 Etienne Pallier
=> ou bien essayer cette nouvelle syntaxe (qui doit eviter d'installer virtualenv, non ? à tester) :
423 268 Etienne Pallier
  python3 -m venv venv_py3_pyros
424 266 Etienne Pallier
425 267 Etienne Pallier
---
426 267 Etienne Pallier
427 256 Jeremy Barneron
Go into the PYROS/install/ folder and Run the install.py script with the parameter install.
428 190 Paul Carensac
429 190 Paul Carensac
(You will be prompted to enter a username, an email, and a password for the superuser)
430 190 Paul Carensac
431 256 Jeremy Barneron
* Mac, Linux and Windows:
432 190 Paul Carensac
<pre>
433 256 Jeremy Barneron
python3 install.py install
434 1 Etienne Pallier
</pre>
435 267 Etienne Pallier
436 190 Paul Carensac
437 262 Etienne Pallier
*TODO: update "create user if exists" => does not work with mysql 5.6 (only with 5.7)*
438 262 Etienne Pallier
439 263 Etienne Pallier
NB: you might need to drop your pyros database (and pyros_test ?) before running the install script (if migrations are too big)
440 263 Etienne Pallier
441 190 Paul Carensac
_If something goes wrong, install manually each package (see section "MANUAL INSTALLATION OF PYTHON PACKAGES, ONE BY ONE")_
442 186 Paul Carensac
443 98 Etienne Pallier
444 9 Etienne Pallier
---
445 9 Etienne Pallier
446 9 Etienne Pallier
h3. (Eclipse only) Set the Python3 virtual environment as the project interpreter
447 9 Etienne Pallier
448 65 Etienne Pallier
See below, in section "NOTES FOR ECLIPSE USERS"
449 9 Etienne Pallier
450 1 Etienne Pallier
---
451 1 Etienne Pallier
452 170 Etienne Pallier
---
453 170 Etienne Pallier
454 17 Etienne Pallier
h2. %{margin-left:0px; font-weight:bold; font-size:25px;  display:block; color:red;}IV - TEST%
455 17 Etienne Pallier
456 108 Etienne Pallier
457 90 Etienne Pallier
(Tests are classes declared in all apps' test.py file. The test classes inherit from django.test.TestCase)
458 17 Etienne Pallier
459 17 Etienne Pallier
You can run the tests suite, just to be sure that the software is well installed.
460 17 Etienne Pallier
461 19 Etienne Pallier
h3. From Terminal
462 19 Etienne Pallier
463 19 Etienne Pallier
464 1 Etienne Pallier
<pre>
465 1 Etienne Pallier
466 219 Paul Carensac
$ cd PYROS/
467 94 Etienne Pallier
468 243 Etienne Pallier
Be sure that at least unit tests pass:
469 257 Jeremy Barneron
$ python3 pyros.py unittest
470 243 Etienne Pallier
471 243 Etienne Pallier
If unit tests pass, then run ALL tests:
472 257 Jeremy Barneron
$ python3 pyros.py test_all
473 242 Etienne Pallier
474 242 Etienne Pallier
NB: if tests do not pass, be sure that Rabbitmq is launched:
475 242 Etienne Pallier
To start rabbitmq on MacOS : 
476 242 Etienne Pallier
$ sudo rabbitmq-server
477 242 Etienne Pallier
478 17 Etienne Pallier
</pre>
479 19 Etienne Pallier
480 160 Paul Carensac
h3. From Eclipse
481 1 Etienne Pallier
482 216 Etienne Pallier
Right-clic on the project / Django / Run Django tests
483 1 Etienne Pallier
484 216 Etienne Pallier
(for more information, see below, in section "NOTES FOR ECLIPSE USERS")
485 25 Paul Carensac
486 160 Paul Carensac
h3. Custom commands
487 27 Paul Carensac
488 25 Paul Carensac
$ [./manage.py] test app.tests                           # Run tests for the application 'app'
489 25 Paul Carensac
$ [./manage.py] test app.tests.ModelTests                # Run test methods declared in the class app.tests.ModelTests
490 25 Paul Carensac
$ [./manage.py] test app.tests.ModelTests.test_method    # Only run the method test_method declared in app.tests.ModelTests
491 33 Etienne Pallier
492 33 Etienne Pallier
493 1 Etienne Pallier
---
494 1 Etienne Pallier
495 170 Etienne Pallier
---
496 170 Etienne Pallier
497 92 Etienne Pallier
h2. %{margin-left:0px; font-weight:bold; font-size:25px;  display:block; color:red;}V - RUN%
498 75 Etienne Pallier
499 109 Etienne Pallier
500 223 Etienne Pallier
Before launching Pyros, check that all the pre-requisites are running :
501 223 Etienne Pallier
502 223 Etienne Pallier
 * RabbitMQ: 
503 223 Etienne Pallier
<pre>
504 223 Etienne Pallier
$ systemctl status rabbitmq-server
505 223 Etienne Pallier
506 223 Etienne Pallier
If inactive, start it:
507 223 Etienne Pallier
$ sudo systemctl start rabbitmq-server
508 223 Etienne Pallier
509 224 Etienne Pallier
(To stop it, use "stop" instead of "start")
510 223 Etienne Pallier
511 223 Etienne Pallier
</pre>
512 223 Etienne Pallier
513 223 Etienne Pallier
 * Mysql (only if you are not using Sqlite):
514 225 Etienne Pallier
<pre>
515 225 Etienne Pallier
$ systemctl status mysqld
516 225 Etienne Pallier
517 225 Etienne Pallier
If inactive, start it:
518 225 Etienne Pallier
$ sudo systemctl start mysqld
519 225 Etienne Pallier
520 225 Etienne Pallier
(To stop it, use "stop" instead of "start")
521 225 Etienne Pallier
</pre>
522 223 Etienne Pallier
523 75 Etienne Pallier
* From the terminal
524 75 Etienne Pallier
525 75 Etienne Pallier
<pre>
526 75 Etienne Pallier
527 95 Etienne Pallier
$ cd PYROS/
528 1 Etienne Pallier
529 259 Jeremy Barneron
$ python3 pyros.py start
530 217 Etienne Pallier
531 217 Etienne Pallier
(To check that this service is actually running, type "$ netstat -an |grep 8000" and you should get "tcp        0      0 127.0.0.1:8000          0.0.0.0:*               LISTEN")
532 217 Etienne Pallier
533 218 Etienne Pallier
(Use instead "python manage.py runserver YOUR_IP_ADDRESS:8000" if you want to access the website from another pc with http://YOUR_IP_ADDRESS:8000) (from within a virtual env, and from src/)
534 217 Etienne Pallier
535 93 Paul Carensac
</pre>
536 75 Etienne Pallier
537 158 Paul Carensac
Now, go to "http://localhost:8000/admin" in your browser
538 91 Etienne Pallier
539 158 Paul Carensac
(and login as "pyros" with the password 'DjangoPyros')
540 105 Etienne Pallier
541 91 Etienne Pallier
(Ctrl-c to stop)
542 91 Etienne Pallier
543 91 Etienne Pallier
544 75 Etienne Pallier
545 106 Etienne Pallier
* From Eclipse : see below, in section "NOTES FOR ECLIPSE USERS"
546 75 Etienne Pallier
547 75 Etienne Pallier
548 1 Etienne Pallier
---
549 1 Etienne Pallier
550 170 Etienne Pallier
---
551 170 Etienne Pallier
552 33 Etienne Pallier
h2. %{margin-left:0px; font-weight:bold; font-size:25px;  display:block; color:red;}NOTES FOR ECLIPSE USERS%
553 35 Etienne Pallier
554 35 Etienne Pallier
0) Install Eclipse (if necessary)
555 35 Etienne Pallier
556 35 Etienne Pallier
Get the Eclipse version for Php
557 35 Etienne Pallier
558 35 Etienne Pallier
Install the plug-in pydev (via install new software, add http://pydev.org/updates)
559 35 Etienne Pallier
560 35 Etienne Pallier
Install the django template editor (via install new software, add http://eclipse.kacprzak.org/updates)
561 35 Etienne Pallier
562 35 Etienne Pallier
1) Deactivate CA certificate verification
563 35 Etienne Pallier
564 35 Etienne Pallier
Window -> Preferences -> Team -> git -> configuration -> Add entry
565 35 Etienne Pallier
566 35 Etienne Pallier
Key = http.sslVerify
567 35 Etienne Pallier
Value = false
568 35 Etienne Pallier
569 35 Etienne Pallier
2) Fetch the project
570 35 Etienne Pallier
571 35 Etienne Pallier
File/Import project from git
572 35 Etienne Pallier
573 35 Etienne Pallier
Select repository source: Clone URI: https://gitlab.irap.omp.eu/epallier/pyros.git
574 35 Etienne Pallier
575 35 Etienne Pallier
Directory: 
576 35 Etienne Pallier
par défaut, il propose : /Users/epallier/git/pyros
577 35 Etienne Pallier
mais on peut le mettre ailleurs (c'est ce que j'ai fait)
578 35 Etienne Pallier
579 35 Etienne Pallier
initial branch: master
580 35 Etienne Pallier
remote name: origin
581 35 Etienne Pallier
582 35 Etienne Pallier
Import as general project
583 35 Etienne Pallier
584 35 Etienne Pallier
Project name: PYROS
585 35 Etienne Pallier
586 35 Etienne Pallier
587 35 Etienne Pallier
3) Configure the project
588 35 Etienne Pallier
589 35 Etienne Pallier
The project is created. Now, you have to set it as a «PyDev » and a « Django » project.
590 35 Etienne Pallier
591 35 Etienne Pallier
clic droit sur le projet / PyDev / set as a PyDev project
592 35 Etienne Pallier
593 35 Etienne Pallier
clic droit sur le projet / PyDev / set as a Django project
594 35 Etienne Pallier
595 35 Etienne Pallier
clic droit sur le projet : on doit maintenant avoir un sous-menu Django
596 35 Etienne Pallier
597 35 Etienne Pallier
clic droit sur le dossier src / PyDev / set as source folder (add to PYTHONPATH)
598 35 Etienne Pallier
599 35 Etienne Pallier
clic droit sur projet / Properties / Pydev-Django :
600 215 Etienne Pallier
  - *Django manage.py : src/manage.py*
601 215 Etienne Pallier
  - *Django settings module : pyros.settings*
602 35 Etienne Pallier
603 35 Etienne Pallier
604 35 Etienne Pallier
4) Set Code style
605 35 Etienne Pallier
606 35 Etienne Pallier
Window/Preferences : Pydev / Editor
607 35 Etienne Pallier
- Auto Imports : uncheck « Do auto import »
608 35 Etienne Pallier
- Code style:
609 35 Etienne Pallier
	- Locals … : camelCase
610 35 Etienne Pallier
	- Methods : camelCase() with first lower
611 35 Etienne Pallier
- Code style / Code Formatter: activer « use autopep8.py for code formatting »
612 35 Etienne Pallier
- Tabs : Tab length : 4
613 35 Etienne Pallier
614 67 Etienne Pallier
5) Now, once the Python3 virtual environment is installed (see above),
615 66 Etienne Pallier
set it in Eclipse as the project interpreter:
616 66 Etienne Pallier
617 68 Etienne Pallier
Right clic on the project / Properties / PyDev - Interpreter/Grammar :
618 66 Etienne Pallier
Grammar version : 3
619 66 Etienne Pallier
620 66 Etienne Pallier
Interpreter : click on « click here to configure an interpreter not listed »
621 66 Etienne Pallier
622 66 Etienne Pallier
click on « New... » :
623 66 Etienne Pallier
- Interpreter name : venv_py35_pyros
624 66 Etienne Pallier
- Interpreter executable : click on « Browse »
625 66 Etienne Pallier
	Select your virtualenv python35 executable (private/venv_py35_pyros/bin/python3.5)
626 66 Etienne Pallier
	click OK
627 66 Etienne Pallier
628 66 Etienne Pallier
*Now, a last thing to do so that Pydev finds Django:*
629 66 Etienne Pallier
630 66 Etienne Pallier
In the Python interpreters list, select your virtual env (venv_py35_pyros)
631 66 Etienne Pallier
632 66 Etienne Pallier
Click on the tab "Libraries"
633 66 Etienne Pallier
634 66 Etienne Pallier
clic on 'New folder', then select your virtualenv's lib/python3.5/site-packages folder
635 66 Etienne Pallier
636 66 Etienne Pallier
OK
637 66 Etienne Pallier
638 66 Etienne Pallier
Interpreter: select now venv_py35_pyros from the list
639 66 Etienne Pallier
640 66 Etienne Pallier
OK
641 62 Etienne Pallier
642 78 Etienne Pallier
6) Test
643 1 Etienne Pallier
644 78 Etienne Pallier
* Right-clic on the project / Django / Run Django tests
645 78 Etienne Pallier
646 78 Etienne Pallier
* Right-clic on the project / Django / Custom command / ...
647 78 Etienne Pallier
648 78 Etienne Pallier
649 78 Etienne Pallier
7) Run
650 70 Etienne Pallier
651 70 Etienne Pallier
Right clic on project -> Django/Custom command/runserver
652 70 Etienne Pallier
653 70 Etienne Pallier
Error on Ubuntu :
654 70 Etienne Pallier
655 70 Etienne Pallier
<pre>
656 70 Etienne Pallier
657 70 Etienne Pallier
Traceback (most recent call last):
658 70 Etienne Pallier
  File "/home/carens_p/git/pyros/src/manage.py", line 8, in <module>
659 70 Etienne Pallier
    from django.core.management import execute_from_command_line
660 70 Etienne Pallier
ImportError: No module named 'django'
661 70 Etienne Pallier
662 70 Etienne Pallier
</pre>
663 70 Etienne Pallier
664 70 Etienne Pallier
Project -> Properties -> Pydev interpreter -> Clic here to configure an interpreter not listed
665 70 Etienne Pallier
666 70 Etienne Pallier
select venv_py35_pyros
667 70 Etienne Pallier
668 70 Etienne Pallier
In Libraries, clic on 'New folder', then select your virtualenv's lib/python3.5/site-packages folder.
669 70 Etienne Pallier
670 70 Etienne Pallier
OK -> re-select venv_py35_pyros in 'Interpreter' dropdown menu
671 70 Etienne Pallier
672 70 Etienne Pallier
Then right clic on project -> Django/Custom command/runserver
673 70 Etienne Pallier
674 70 Etienne Pallier
check http://localhost:8000/
675 70 Etienne Pallier
676 70 Etienne Pallier
677 62 Etienne Pallier
---
678 62 Etienne Pallier
679 62 Etienne Pallier
---
680 62 Etienne Pallier
681 250 Jeremy Barneron
h2. %{margin-left:0px; font-weight:bold; font-size:25px;  display:block; color:red;}NOTES FOR PYCHARM USERS%
682 250 Jeremy Barneron
683 250 Jeremy Barneron
1) Install Pycharm
684 250 Jeremy Barneron
685 251 Jeremy Barneron
2) import pyros project
686 251 Jeremy Barneron
687 252 Jeremy Barneron
3) Mark the src directory and simulators directory as source root directories
688 250 Jeremy Barneron
689 252 Jeremy Barneron
4) Go in file -> settings (CTRL + ALT + S) -> Project : Pyros -> Project Interpreter
690 258 Jeremy Barneron
   Add an interpreter which is the one from your virtual environment : Add Local -> find the python 3 binary in your virtualenv
691 250 Jeremy Barneron
692 252 Jeremy Barneron
5) Go in Language & Frameworks -> Django and set the django project root / Settings (pyros/settings.py) / Manage script
693 250 Jeremy Barneron
694 250 Jeremy Barneron
695 250 Jeremy Barneron
---
696 250 Jeremy Barneron
697 250 Jeremy Barneron
---
698 250 Jeremy Barneron
699 81 Etienne Pallier
h2. %{margin-left:0px; font-weight:bold; font-size:25px;  display:block; color:red;}MANUAL INSTALLATION OF PYTHON PACKAGES ONE BY ONE%
700 81 Etienne Pallier
701 172 Etienne Pallier
*Follow these steps only if the previous guided and nearly automatic installation did not work for you*
702 100 Etienne Pallier
703 172 Etienne Pallier
704 174 Etienne Pallier
h3. (Only if using Mysql) Create the database "pyros" and the pyros user
705 174 Etienne Pallier
706 174 Etienne Pallier
Only if you are using Mysql, you need to create an empty database "pyros"
707 174 Etienne Pallier
(which will be filled automatically by django)
708 174 Etienne Pallier
709 174 Etienne Pallier
<pre>
710 174 Etienne Pallier
$ mysql -u root -p
711 174 Etienne Pallier
(enter your root password)
712 174 Etienne Pallier
713 174 Etienne Pallier
$ mysql> create database if not exists pyros;
714 174 Etienne Pallier
</pre>
715 174 Etienne Pallier
716 174 Etienne Pallier
The user creation depends on your MySQL version :
717 174 Etienne Pallier
718 174 Etienne Pallier
 * 5.7 and above :
719 174 Etienne Pallier
<pre>
720 174 Etienne Pallier
$ mysql> DROP USER IF EXISTS pyros;
721 174 Etienne Pallier
$ mysql> CREATE USER 'pyros' IDENTIFIED BY 'DjangoPyros';
722 174 Etienne Pallier
$ mysql> GRANT ALL PRIVILEGES ON pyros.* TO pyros;
723 174 Etienne Pallier
</pre>
724 174 Etienne Pallier
725 174 Etienne Pallier
 * under 5.7 :
726 174 Etienne Pallier
<pre>
727 174 Etienne Pallier
$ mysql> GRANT USAGE ON *.* TO 'pyros';
728 174 Etienne Pallier
$ mysql> DROP USER 'pyros';
729 174 Etienne Pallier
$ mysql> CREATE USER 'pyros' IDENTIFIED BY 'DjangoPyros';
730 174 Etienne Pallier
$ mysql> GRANT ALL PRIVILEGES ON pyros.* TO pyros;
731 174 Etienne Pallier
</pre>
732 174 Etienne Pallier
733 174 Etienne Pallier
If none of these solution work, check on the internet to create a user named pyros with the password DjangoPyros.
734 174 Etienne Pallier
735 100 Etienne Pallier
h3. Create a Python3 virtual environment dedicated to the project (inside the project folder)
736 100 Etienne Pallier
737 100 Etienne Pallier
<pre>
738 100 Etienne Pallier
739 100 Etienne Pallier
$ mkdir private/
740 100 Etienne Pallier
741 100 Etienne Pallier
$ cd private/
742 100 Etienne Pallier
743 100 Etienne Pallier
$ which python3.5 ("where python" for windows)
744 100 Etienne Pallier
/opt/local/bin/python3.5
745 100 Etienne Pallier
746 100 Etienne Pallier
$ virtualenv venv_py35_pyros -p /opt/local/bin/python3.5
747 100 Etienne Pallier
=> creates a venv_py35_pyros/ folder inside PYROS/private/
748 100 Etienne Pallier
749 100 Etienne Pallier
</pre>
750 100 Etienne Pallier
751 100 Etienne Pallier
752 100 Etienne Pallier
---
753 100 Etienne Pallier
754 100 Etienne Pallier
h3. Activate the python virtual environment (from inside the project)
755 100 Etienne Pallier
756 100 Etienne Pallier
<pre>
757 100 Etienne Pallier
758 100 Etienne Pallier
$ pwd
759 100 Etienne Pallier
.../PYROS/private
760 100 Etienne Pallier
761 100 Etienne Pallier
$ source ./venv_py35_pyros/bin/activate (venv_py35_pyros/Scripts/activate on Windows)
762 100 Etienne Pallier
763 100 Etienne Pallier
</pre>
764 100 Etienne Pallier
765 100 Etienne Pallier
---
766 100 Etienne Pallier
767 100 Etienne Pallier
h3. Install needed python packages
768 100 Etienne Pallier
769 81 Etienne Pallier
Check that the virtual environment is activated
770 81 Etienne Pallier
<pre>
771 81 Etienne Pallier
$ python -V
772 81 Etienne Pallier
Python 3...
773 81 Etienne Pallier
774 81 Etienne Pallier
$ which pip
775 81 Etienne Pallier
.../PYROS/venv_py35_pyros/bin/pip
776 81 Etienne Pallier
</pre>
777 81 Etienne Pallier
778 81 Etienne Pallier
779 81 Etienne Pallier
Upgrade pip to last version available:
780 81 Etienne Pallier
<pre>
781 81 Etienne Pallier
$ pip install --upgrade pip
782 81 Etienne Pallier
Collecting pip
783 81 Etienne Pallier
  Downloading pip-8.1.1-py2.py3-none-any.whl (1.2MB)
784 81 Etienne Pallier
Installing collected packages: pip
785 81 Etienne Pallier
  Found existing installation: pip 7.1.2
786 81 Etienne Pallier
    Uninstalling pip-7.1.2:
787 81 Etienne Pallier
      Successfully uninstalled pip-7.1.2
788 81 Etienne Pallier
Successfully installed pip-8.1.1
789 81 Etienne Pallier
790 81 Etienne Pallier
Upgrade wheel to last version available:
791 81 Etienne Pallier
$ pip install --upgrade wheel
792 81 Etienne Pallier
Collecting wheel
793 81 Etienne Pallier
  Downloading wheel-0.29.0-py2.py3-none-any.whl (66kB)
794 81 Etienne Pallier
Installing collected packages: wheel
795 81 Etienne Pallier
  Found existing installation: wheel 0.24.0
796 81 Etienne Pallier
    Uninstalling wheel-0.24.0:
797 81 Etienne Pallier
      Successfully uninstalled wheel-0.24.0
798 81 Etienne Pallier
Successfully installed wheel-0.29.0
799 81 Etienne Pallier
800 81 Etienne Pallier
</pre>
801 81 Etienne Pallier
802 81 Etienne Pallier
Go into the install/ folder:
803 81 Etienne Pallier
<pre>
804 81 Etienne Pallier
$ cd .../PYROS/install/
805 81 Etienne Pallier
</pre>
806 81 Etienne Pallier
807 84 Etienne Pallier
Install all the needed python packages at once:
808 85 Etienne Pallier
<pre>
809 1 Etienne Pallier
$ pip install -r REQUIREMENTS.txt
810 85 Etienne Pallier
</pre>
811 84 Etienne Pallier
812 84 Etienne Pallier
If something goes wrong, install them one by one:
813 62 Etienne Pallier
814 62 Etienne Pallier
  * *Install Django* :
815 62 Etienne Pallier
<pre>
816 62 Etienne Pallier
$ pip install django
817 62 Etienne Pallier
Collecting django
818 62 Etienne Pallier
  Downloading Django-1.9.4-py2.py3-none-any.whl (6.6MB)
819 62 Etienne Pallier
Installing collected packages: django
820 62 Etienne Pallier
Successfully installed django-1.9.4
821 62 Etienne Pallier
822 62 Etienne Pallier
$ pip install django-admin-tools
823 62 Etienne Pallier
Collecting django-admin-tools
824 62 Etienne Pallier
  Downloading django_admin_tools-0.7.2-py2.py3-none-any.whl (289kB)
825 62 Etienne Pallier
Installing collected packages: django-admin-tools
826 62 Etienne Pallier
Successfully installed django-admin-tools-0.7.2
827 62 Etienne Pallier
828 62 Etienne Pallier
$ pip install django-debug-toolbar
829 62 Etienne Pallier
Collecting django-debug-toolbar
830 62 Etienne Pallier
  Downloading django_debug_toolbar-1.4-py2.py3-none-any.whl (212kB)
831 62 Etienne Pallier
Requirement already satisfied (use --upgrade to upgrade): Django>=1.7 in ./venv_py35_pyros/lib/python3.5/site-packages (from django-debug-toolbar)
832 62 Etienne Pallier
Collecting sqlparse (from django-debug-toolbar)
833 62 Etienne Pallier
  Downloading sqlparse-0.1.19.tar.gz (58kB)
834 62 Etienne Pallier
Building wheels for collected packages: sqlparse
835 62 Etienne Pallier
  Running setup.py bdist_wheel for sqlparse ... done
836 62 Etienne Pallier
  Stored in directory: /Users/epallier/Library/Caches/pip/wheels/7b/d4/72/6011bb100dd5fc213164e4bbee13d4e03261dd54ce6a5de6b8
837 62 Etienne Pallier
Successfully built sqlparse
838 62 Etienne Pallier
Installing collected packages: sqlparse, django-debug-toolbar
839 62 Etienne Pallier
Successfully installed django-debug-toolbar-1.4 sqlparse-0.1.19
840 62 Etienne Pallier
841 62 Etienne Pallier
$ pip install django-extensions
842 62 Etienne Pallier
Collecting django-extensions
843 62 Etienne Pallier
  Downloading django_extensions-1.6.1-py2.py3-none-any.whl (202kB)
844 62 Etienne Pallier
Collecting six>=1.2 (from django-extensions)
845 62 Etienne Pallier
  Downloading six-1.10.0-py2.py3-none-any.whl
846 62 Etienne Pallier
Installing collected packages: six, django-extensions
847 62 Etienne Pallier
Successfully installed django-extensions-1.6.1 six-1.10.0
848 62 Etienne Pallier
849 62 Etienne Pallier
$ pip install django-suit
850 62 Etienne Pallier
Collecting django-suit
851 62 Etienne Pallier
  Downloading django-suit-0.2.18.tar.gz (587kB)
852 62 Etienne Pallier
Building wheels for collected packages: django-suit
853 62 Etienne Pallier
  Running setup.py bdist_wheel for django-suit ... done
854 62 Etienne Pallier
  Stored in directory: /Users/epallier/Library/Caches/pip/wheels/12/8b/9a/e02ab0ad9229881638aa040d47d77c8f562999533811927d41
855 62 Etienne Pallier
Successfully built django-suit
856 62 Etienne Pallier
Installing collected packages: django-suit
857 62 Etienne Pallier
Successfully installed django-suit-0.2.18
858 62 Etienne Pallier
859 62 Etienne Pallier
</pre>
860 62 Etienne Pallier
861 62 Etienne Pallier
  * *Install the django boostrap css package* :
862 62 Etienne Pallier
<pre>
863 62 Etienne Pallier
$ pip install django-bootstrap3
864 62 Etienne Pallier
</pre>
865 62 Etienne Pallier
(==> 'bootstrap3' is then to be added as an application in settings.py -> INSTALLED_APPS)
866 62 Etienne Pallier
867 62 Etienne Pallier
  * *Install the web application server gunicorn (will be used in production instead of the dev django web server)* :
868 62 Etienne Pallier
<pre>
869 62 Etienne Pallier
$ pip install gunicorn
870 62 Etienne Pallier
Collecting gunicorn
871 62 Etienne Pallier
  Downloading gunicorn-19.4.5-py2.py3-none-any.whl (112kB)
872 62 Etienne Pallier
Installing collected packages: gunicorn
873 62 Etienne Pallier
Successfully installed gunicorn-19.4.5
874 62 Etienne Pallier
</pre>
875 62 Etienne Pallier
876 62 Etienne Pallier
  * *Install the python mysql client* (not needed if you want to use sqlite):
877 62 Etienne Pallier
<pre>
878 62 Etienne Pallier
$ pip install mysqlclient
879 62 Etienne Pallier
...
880 62 Etienne Pallier
</pre>
881 62 Etienne Pallier
882 146 Etienne Pallier
   * => If issue under Mac OS X:
883 62 Etienne Pallier
<pre>
884 62 Etienne Pallier
$ pip install mysqlclient
885 62 Etienne Pallier
Collecting mysqlclient
886 62 Etienne Pallier
  Downloading mysqlclient-1.3.7.tar.gz (79kB)
887 62 Etienne Pallier
Building wheels for collected packages: mysqlclient
888 62 Etienne Pallier
  Running setup.py bdist_wheel for mysqlclient ... error
889 62 Etienne Pallier
890 62 Etienne Pallier
  ----------------------------------------
891 62 Etienne Pallier
  Failed building wheel for mysqlclient
892 62 Etienne Pallier
  Running setup.py clean for mysqlclient
893 62 Etienne Pallier
Failed to build mysqlclient
894 62 Etienne Pallier
Installing collected packages: mysqlclient
895 62 Etienne Pallier
  Running setup.py install for mysqlclient ... done
896 62 Etienne Pallier
Successfully installed mysqlclient-1.3.7
897 62 Etienne Pallier
898 62 Etienne Pallier
BOUH !!!
899 1 Etienne Pallier
900 152 Etienne Pallier
=> Need to upgrade wheel:
901 146 Etienne Pallier
902 62 Etienne Pallier
$ pip install --upgrade wheel
903 62 Etienne Pallier
Collecting wheel
904 62 Etienne Pallier
  Downloading wheel-0.29.0-py2.py3-none-any.whl (66kB)
905 62 Etienne Pallier
Installing collected packages: wheel
906 62 Etienne Pallier
  Found existing installation: wheel 0.24.0
907 62 Etienne Pallier
    Uninstalling wheel-0.24.0:
908 62 Etienne Pallier
      Successfully uninstalled wheel-0.24.0
909 62 Etienne Pallier
Successfully installed wheel-0.29.0
910 62 Etienne Pallier
911 153 Etienne Pallier
YES !!!
912 1 Etienne Pallier
913 154 Etienne Pallier
Only if necessary, you can reinstall mysqlclient:
914 153 Etienne Pallier
$ pip uninstall mysqlclient
915 62 Etienne Pallier
$ pip install mysqlclient
916 62 Etienne Pallier
Collecting mysqlclient
917 62 Etienne Pallier
  Using cached mysqlclient-1.3.7.tar.gz
918 62 Etienne Pallier
Building wheels for collected packages: mysqlclient
919 62 Etienne Pallier
  Running setup.py bdist_wheel for mysqlclient ... done
920 62 Etienne Pallier
  Stored in directory: /Users/epallier/Library/Caches/pip/wheels/9b/06/50/d11418c26cf8f2156b13d4363b5afde8e7e75ebb8540d0228d
921 62 Etienne Pallier
Successfully built mysqlclient
922 62 Etienne Pallier
Installing collected packages: mysqlclient
923 62 Etienne Pallier
Successfully installed mysqlclient-1.3.7
924 62 Etienne Pallier
925 1 Etienne Pallier
</pre>
926 62 Etienne Pallier
927 146 Etienne Pallier
   * => If issue under Windows
928 62 Etienne Pallier
<pre>
929 62 Etienne Pallier
Same message as the issue for Mac.
930 146 Etienne Pallier
931 204 Paul Carensac
=> Need to install wheel manually :
932 62 Etienne Pallier
933 62 Etienne Pallier
Go to http://www.lfd.uci.edu/~gohlke/pythonlibs/#mysqlclient to download the newest mysqlclient wheel
934 62 Etienne Pallier
935 62 Etienne Pallier
$ pip install path\to\mysqlclient\wheel
936 62 Etienne Pallier
937 154 Etienne Pallier
(No need to redo "pip install mysqlclient")
938 62 Etienne Pallier
</pre>
939 163 Paul Carensac
940 163 Paul Carensac
  * *Install the julian day converter* :
941 163 Paul Carensac
<pre>
942 163 Paul Carensac
$ pip install jdcal
943 163 Paul Carensac
</pre>
944 182 Paul Carensac
945 188 Paul Carensac
  * *Install Celery and dependencies* :
946 182 Paul Carensac
<pre>
947 182 Paul Carensac
$ pip install celery
948 1 Etienne Pallier
$ pip install django-celery
949 188 Paul Carensac
$ pip install Twisted==16.0.0
950 188 Paul Carensac
</pre>
951 188 Paul Carensac
952 188 Paul Carensac
  * *Install django test without migrations (compulsory to use the prod DB for tests)* :
953 188 Paul Carensac
<pre>
954 188 Paul Carensac
$ pip install django-test-without-migrations==0.4
955 188 Paul Carensac
</pre>
956 188 Paul Carensac
957 188 Paul Carensac
  * *Install voevent parser* :
958 188 Paul Carensac
<pre>
959 188 Paul Carensac
$ pip install voevent-parse==0.9.5
960 188 Paul Carensac
</pre>
961 188 Paul Carensac
962 188 Paul Carensac
963 188 Paul Carensac
  * *Install other dependencies (useful ? TBC)* :
964 188 Paul Carensac
<pre>
965 188 Paul Carensac
$ pip install amqplib==1.0.2
966 188 Paul Carensac
$ pip install pluggy==0.3.1
967 188 Paul Carensac
$ pip install py==1.4.31
968 182 Paul Carensac
</pre>