Project Installation

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