problem in install openquake 1.0.0

153 views
Skip to first unread message

hasan mousavi

unread,
Jun 30, 2013, 5:23:18 PM6/30/13
to openqu...@googlegroups.com
Dear Developers,
I had openquake version 0.8.3. previously and i work with it.
I installed new version of software from: https://github.com/gem/oq-engine/wiki/Installing-the-OpenQuake-Engine-from-source-code without eny action to remove the old version.

I run openquake and get feedback so:

******************
root@hasan-Vostro-1400:~/oq-engine# ./bin/openquake --run-hazard=./demos/hazard/SimpleFaultSourceClassicalPSHA/job.ini --no-distribute
Traceback (most recent call last):
  File "./bin/openquake", line 73, in <module>
    from openquake.engine.utils import config
ImportError: No module named engine.utils
root@hasan-Vostro-1400:~#

*******************
root@hasan-Vostro-1400:~/oq-engine# ./bin/openquake --help
Traceback (most recent call last):
  File "./bin/openquake", line 73, in <module>
    from openquake.engine.utils import config
ImportError: No module named engine.utils
root@hasan-Vostro-1400:~/oq-engine#

*****************
I  got suspect to three cases in the installation process is as follows:

**************

1) I add path so:

root@hasan-Vostro-1400:~# gedit .profile

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

I added the following line to the end of the text:

export PYTHONPATH=.:/home/hasan/oq-engine:/home/hasan/oq-hazardlib:/home/hasan/oq-risklib:/home/hasan/oq-nrmllib:$PYTHONPATH

I don't know this is correct or not.

****************

2) Setting up the DB schema:

root@hasan-Vostro-1400:~/oq-engine# sudo -u postgres ./bin/oq_create_db --db-user=postgres --db-name=openquake --schema-path=openquake/engine/db/schema
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named engine
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named engine.settings
!! This will destroy *ALL* data in the OpenQuake database named openquake !!
Press <enter> to continue or Ctrl-C to abort
I pressed <enter>
.. Dropping database openquake ..
.. Dropping table space admin_ts ..
.. Dropping table space hzrdi_ts ..
.. Dropping table space hzrdr_ts ..
.. Dropping table space riski_ts ..
.. Dropping table space riskr_ts ..
.. Dropping table space uiapi_ts ..
.. Dropping table space htemp_ts ..
.. Current table spaces: eqcat_ts oqmif_ts pg_default pg_global
.. Creating database openquake ..
.. Loading postgis functions/data into openquake ..
.. Running schema definition file: openquake/engine/db/schema/openquake.sql ..
.. Running functions file: openquake/engine/db/schema/functions.sql ..
.. Loading static data from: openquake/engine/db/schema/load.sql ..
.. Running comments file: openquake/engine/db/schema/comments.sql ..
.. Running security settings file: openquake/engine/db/schema/security.sql ..
.. Applying index definitions: openquake/engine/db/schema/indexes.sql ..
.. Done ..
root@hasan-Vostro-1400:~/oq-engine# cd

***************

3) Patching Django:

root@hasan-Vostro-1400:~# curl -O https://code.djangoproject.com/raw-attachment/ticket/16778/postgis-adapter-2.patch
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1229  100  1229    0     0    458      0  0:00:02  0:00:02 --:--:--  1073
root@hasan-Vostro-1400:~# patch /usr/lib/python2.7/dist-packages/django/contrib/gis/db/backends/postgis/adapter.py ./postgis-adapter-2.patch
patching file /usr/lib/python2.7/dist-packages/django/contrib/gis/db/backends/postgis/adapter.py
Reversed (or previously applied) patch detected!  Assume -R? [n] n
Apply anyway? [n] y
Hunk #1 FAILED at 12.
Hunk #2 FAILED at 26.
2 out of 2 hunks FAILED -- saving rejects to file /usr/lib/python2.7/dist-packages/django/contrib/gis/db/backends/postgis/adapter.py.rej
root@hasan-Vostro-1400:~#

*****************

Please guide me to solve the problem.
Hasan

Lars Butler

unread,
Jul 1, 2013, 3:37:10 AM7/1/13
to openqu...@googlegroups.com
Hi Hasan,

Comments below.

Lars


If the OQ source is in those directories, this should be just fine. 
Looks good. 

***************

3) Patching Django:

root@hasan-Vostro-1400:~# curl -O https://code.djangoproject.com/raw-attachment/ticket/16778/postgis-adapter-2.patch
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1229  100  1229    0     0    458      0  0:00:02  0:00:02 --:--:--  1073
root@hasan-Vostro-1400:~# patch /usr/lib/python2.7/dist-packages/django/contrib/gis/db/backends/postgis/adapter.py ./postgis-adapter-2.patch
patching file /usr/lib/python2.7/dist-packages/django/contrib/gis/db/backends/postgis/adapter.py
Reversed (or previously applied) patch detected!  Assume -R? [n] n
Apply anyway? [n] y
Hunk #1 FAILED at 12.
Hunk #2 FAILED at 26.
2 out of 2 hunks FAILED -- saving rejects to file /usr/lib/python2.7/dist-packages/django/contrib/gis/db/backends/postgis/adapter.py.rej
root@hasan-Vostro-1400:~# 
 
Probably you have already patched this file once. There is no need to do it again. Once you have your PYTHONPATH set up (as you detailed above), everything should work.

*****************

Please guide me to solve the problem.
Hasan

--
You received this message because you are subscribed to the Google Groups "OpenQuake Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openquake-de...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

hasan mousavi

unread,
Jul 2, 2013, 6:33:33 AM7/2/13
to openqu...@googlegroups.com
Hi Lars
My problem was resolved
Very thanks
Hasan
Reply all
Reply to author
Forward
0 new messages