Project Installation

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