Project Installation

Version 308 (Quentin Durand, 12/01/2017 02:55 pm)

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