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