Project Installation

Version 265 (Etienne Pallier, 03/10/2017 04:57 pm)

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