Project Installation

Version 256 (Jeremy Barneron, 01/18/2017 06:03 pm)

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