Problem deploying rapid-pro

162 views
Skip to first unread message

Syed Zakriya

unread,
Feb 11, 2015, 8:24:08 AM2/11/15
to rapi...@googlegroups.com
Hi,

I have got the following softwares installed on my Server:
1. DJango
2. Cerely
3. PostGRE SQL with POST GIS extensions.
3. Redis
4. Lessc
5. Coffee

I am trying to perform all the steps specified in below link:

However i'm stuck up in the third step from the last, that is building an virtual environment. 
When i execute the command:
$virtualenv env

I get an error:

Using base prefix 'C:\\Python34'
New python executable in env\Scripts\python.exe
Failed to import the site module
Traceback (most recent call last):
  File "C:\Users\syed.zakriya\Desktop\rapidpro-master\rapidpro-master\env\lib\si
te.py", line 67, in <module>
    import os
  File "C:\Users\syed.zakriya\Desktop\rapidpro-master\rapidpro-master\env\lib\os
.py", line 616, in <module>
    from _collections_abc import MutableMapping
ImportError: No module named '_collections_abc'
ERROR: The executable env\Scripts\python.exe is not functioning
ERROR: It thinks sys.prefix is 'c:\\users\\syed.zakriya\\desktop\\rapidpro-maste
r\\rapidpro-master' (should be 'c:\\users\\syed.zakriya\\desktop\\rapidpro-maste
r\\rapidpro-master\\env')
ERROR: virtualenv is not compatible with this system or executable
Note: some Windows users have reported this error when they installed Python for
 "Only this user" or have multiple versions of Python installed. Copying the app
ropriate PythonXX.dll to the virtualenv Scripts/ directory may fix this problem.

As suggested in the error, i tried copying the pythonX.dll to the scripts folder under /env, but i still get the same error.

Any suggestion on proceeding about with the same will be really helpful.

Thanks in advance.

Regards,
Syed

Nic Pottier

unread,
Feb 12, 2015, 11:46:11 AM2/12/15
to Syed Zakriya, rapi...@googlegroups.com
Syed,

This looks like a problem with your virtual environment install on
Windows. I'm not at all familiar with Python in Windows, but I would
suggest doing some googling to look for possible solutions as it isn't
anything specific to RapidPro.

Here's the first hit I found when doing a search in Google:
https://github.com/pypa/virtualenv/issues/87

Cheers,

-Nic
> --
> You received this message because you are subscribed to the Google Groups
> "rapidpro" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to rapidpro+u...@googlegroups.com.
> To post to this group, send email to rapi...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rapidpro/48f746d3-5ff7-4b5a-b603-7f672a6a5e9b%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Syed Zakriya

unread,
Feb 13, 2015, 1:57:04 AM2/13/15
to Nic Pottier, rapi...@googlegroups.com
Hi Nic,

Thanks for the info. Finally resolved that. Currently stuck at the second last step. That is syncing to the database. Below is the issue i'm getting. Any idea on resolving this?

C:\Users\syed.zakriya\Desktop\rapidpro-master\rapidpro-master>.\env\Scripts\acti
vate
(env) C:\Users\syed.zakriya\Desktop\rapidpro-master\rapidpro-master>python manag
e.py syncdb
Traceback (most recent call last):
  File "manage.py", line 9, in <module>
    execute_from_command_line(sys.argv)
  File "C:\Users\syed.zakriya\Desktop\rapidpro-master\rapidpro-master\env\lib\si
te-packages\django\core\management\__init__.py", line 385, in execute_from_comma
nd_line
    utility.execute()
  File "C:\Users\syed.zakriya\Desktop\rapidpro-master\rapidpro-master\env\lib\si
te-packages\django\core\management\__init__.py", line 345, in execute
    settings.INSTALLED_APPS
  File "C:\Users\syed.zakriya\Desktop\rapidpro-master\rapidpro-master\env\lib\si
te-packages\django\conf\__init__.py", line 46, in __getattr__
    self._setup(name)
  File "C:\Users\syed.zakriya\Desktop\rapidpro-master\rapidpro-master\env\lib\si
te-packages\django\conf\__init__.py", line 42, in _setup
    self._wrapped = Settings(settings_module)
  File "C:\Users\syed.zakriya\Desktop\rapidpro-master\rapidpro-master\env\lib\si
te-packages\django\conf\__init__.py", line 94, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "C:\Python27\Lib\importlib\__init__.py", line 37, in import_module
    __import__(name)
  File "C:\Users\syed.zakriya\Desktop\rapidpro-master\rapidpro-master\temba\__in
it__.py", line 5, in <module>
    from .temba_celery import app as celery_app
  File "C:\Users\syed.zakriya\Desktop\rapidpro-master\rapidpro-master\temba\temb
a_celery.py", line 23, in <module>
    app.config_from_object('django.conf:settings')
  File "C:\Users\syed.zakriya\Desktop\rapidpro-master\rapidpro-master\env\lib\si
te-packages\celery\app\base.py", line 297, in config_from_object
    return self.loader.config_from_object(obj, silent=silent)
  File "C:\Users\syed.zakriya\Desktop\rapidpro-master\rapidpro-master\env\lib\si
te-packages\celery\loaders\base.py", line 145, in config_from_object
    self._conf = force_mapping(obj)
  File "C:\Users\syed.zakriya\Desktop\rapidpro-master\rapidpro-master\env\lib\si
te-packages\celery\datastructures.py", line 52, in force_mapping
    return DictAttribute(m) if not isinstance(m, Mapping) else m
  File "C:\Users\syed.zakriya\Desktop\rapidpro-master\rapidpro-master\env\lib\ab
c.py", line 131, in __instancecheck__
    subclass = getattr(instance, '__class__', None)
  File "C:\Users\syed.zakriya\Desktop\rapidpro-master\rapidpro-master\env\lib\si
te-packages\django\utils\functional.py", line 224, in inner
    self._setup()
  File "C:\Users\syed.zakriya\Desktop\rapidpro-master\rapidpro-master\env\lib\si
te-packages\django\conf\__init__.py", line 42, in _setup
    self._wrapped = Settings(settings_module)
  File "C:\Users\syed.zakriya\Desktop\rapidpro-master\rapidpro-master\env\lib\si
te-packages\django\conf\__init__.py", line 94, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "C:\Python27\Lib\importlib\__init__.py", line 37, in import_module
    __import__(name)
  File "C:\Users\syed.zakriya\Desktop\rapidpro-master\rapidpro-master\temba\sett
ings.py", line 1
SyntaxError: Non-ASCII character '\xff' in file C:\Users\syed.zakriya\Desktop\ra
pidpro-master\rapidpro-master\temba\settings.py on line 1, but no encoding decla

Please help!!!

Regards,
Syed

Nic Pottier

unread,
Feb 13, 2015, 1:26:55 PM2/13/15
to Syed Zakriya, rapi...@googlegroups.com
Hi Syed,

Looks like your settings file has some unicode or other garbage on the
first line that Windows is blowing up on.

I'd take a look there.

-Nic

Syed Zakriya

unread,
Feb 16, 2015, 2:10:42 AM2/16/15
to Nic Pottier, rapi...@googlegroups.com
Hi Nic,

Yes the problem was in windows the ln command does not works fine even though i have cygwin. Anyways solve this issue as well. 

I'm getting some issue in the GIS library while executing the command:

python manage.py syncdb

Below is the issue:


(env) C:\Users\syed.zakriya\Desktop\rapidpro-master\rapidpro-master>python manag
e.py syncdb
Traceback (most recent call last):
  File "manage.py", line 9, in <module>
    execute_from_command_line(sys.argv)
  File "C:\Users\syed.zakriya\Desktop\rapidpro-master\rapidpro-master\env\lib\si
te-packages\django\core\management\__init__.py", line 385, in execute_from_comma
nd_line
    utility.execute()
  File "C:\Users\syed.zakriya\Desktop\rapidpro-master\rapidpro-master\env\lib\si
te-packages\django\core\management\__init__.py", line 354, in execute
    django.setup()
  File "C:\Users\syed.zakriya\Desktop\rapidpro-master\rapidpro-master\env\lib\si
te-packages\django\__init__.py", line 21, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "C:\Users\syed.zakriya\Desktop\rapidpro-master\rapidpro-master\env\lib\si
te-packages\django\apps\registry.py", line 108, in populate
    app_config.import_models(all_models)
  File "C:\Users\syed.zakriya\Desktop\rapidpro-master\rapidpro-master\env\lib\si
te-packages\django\apps\config.py", line 202, in import_models
    self.models_module = import_module(models_module_name)
  File "C:\Python27\Lib\importlib\__init__.py", line 37, in import_module
    __import__(name)
  File "C:\Users\syed.zakriya\Desktop\rapidpro-master\rapidpro-master\env\lib\si
te-packages\django\contrib\auth\models.py", line 40, in <module>
    class Permission(models.Model):
  File "C:\Users\syed.zakriya\Desktop\rapidpro-master\rapidpro-master\env\lib\si
te-packages\django\db\models\base.py", line 124, in __new__
    new_class.add_to_class('_meta', Options(meta, **kwargs))
  File "C:\Users\syed.zakriya\Desktop\rapidpro-master\rapidpro-master\env\lib\si
te-packages\django\db\models\base.py", line 299, in add_to_class
    value.contribute_to_class(cls, name)
  File "C:\Users\syed.zakriya\Desktop\rapidpro-master\rapidpro-master\env\lib\si
te-packages\django\db\models\options.py", line 166, in contribute_to_class
    self.db_table = truncate_name(self.db_table, connection.ops.max_name_length(
))
  File "C:\Users\syed.zakriya\Desktop\rapidpro-master\rapidpro-master\env\lib\si
te-packages\django\db\__init__.py", line 40, in __getattr__
    return getattr(connections[DEFAULT_DB_ALIAS], item)
  File "C:\Users\syed.zakriya\Desktop\rapidpro-master\rapidpro-master\env\lib\si
te-packages\django\db\utils.py", line 242, in __getitem__
    backend = load_backend(db['ENGINE'])
  File "C:\Users\syed.zakriya\Desktop\rapidpro-master\rapidpro-master\env\lib\si
te-packages\django\db\utils.py", line 108, in load_backend
    return import_module('%s.base' % backend_name)
  File "C:\Python27\Lib\importlib\__init__.py", line 37, in import_module
    __import__(name)
  File "C:\Users\syed.zakriya\Desktop\rapidpro-master\rapidpro-master\env\lib\si
te-packages\django\contrib\gis\db\backends\postgis\base.py", line 4, in <module>

    from django.contrib.gis.db.backends.postgis.introspection import PostGISIntr
ospection
  File "C:\Users\syed.zakriya\Desktop\rapidpro-master\rapidpro-master\env\lib\si
te-packages\django\contrib\gis\db\backends\postgis\introspection.py", line 2, in
 <module>
    from django.contrib.gis.gdal import OGRGeomType
  File "C:\Users\syed.zakriya\Desktop\rapidpro-master\rapidpro-master\env\lib\si
te-packages\django\contrib\gis\gdal\__init__.py", line 46, in <module>
    from django.contrib.gis.gdal.driver import Driver  # NOQA
  File "C:\Users\syed.zakriya\Desktop\rapidpro-master\rapidpro-master\env\lib\si
te-packages\django\contrib\gis\gdal\driver.py", line 5, in <module>
    from django.contrib.gis.gdal.prototypes import ds as capi
  File "C:\Users\syed.zakriya\Desktop\rapidpro-master\rapidpro-master\env\lib\si
te-packages\django\contrib\gis\gdal\prototypes\ds.py", line 8, in <module>
    from django.contrib.gis.gdal.libgdal import lgdal
  File "C:\Users\syed.zakriya\Desktop\rapidpro-master\rapidpro-master\env\lib\si
te-packages\django\contrib\gis\gdal\libgdal.py", line 48, in <module>
    lgdal = CDLL(lib_path)
  File "C:\Python27\Lib\ctypes\__init__.py", line 365, in __init__
    self._handle = _dlopen(self._name, mode)
WindowsError: [Error 193] %1 is not a valid Win32 application

I have added a line:

GDAL_LIBRARY_PATH = "C:/OSGeo4W/bin/gdal19.dll"

But still i get the same issue.

Any info on this shall be really helpful. And i can make a document for running rapidpro on windows.

Regards,
Syed

Syed Zakriya

unread,
Feb 16, 2015, 7:37:09 AM2/16/15
to Nic Pottier, rapi...@googlegroups.com
Hi Nic,

I was able to resolve the above error. It was due to a 32-bit installation of POSTgis extensions in a 64 bit machine. 

I think i have almost reached the launching point.

There is just one hurdle now while syncing the database. Below is the description:


(env) C:\Users\syed.zakriya\Desktop\RAPIDPRO\rapidpro>python manage.py syncdb
SYED_ZAKRIYAAAAA__lib path = C:\OSGeo4W64\bin\gdal111.dll
Raven is not configured (logging is disabled). Please see the documentation for
more information.
INFO 2015-02-16 04:30:05,440 base 2792 3512 Raven is not configured (logging is
disabled). Please see the documentation for more information.
Generating LALR tables
Traceback (most recent call last):
  File "manage.py", line 9, in <module>
    execute_from_command_line(sys.argv)
  File "C:\Users\syed.zakriya\Desktop\RAPIDPRO\rapidpro\env\lib\site-packages\dj
ango\core\management\__init__.py", line 385, in execute_from_command_line
    utility.execute()
  File "C:\Users\syed.zakriya\Desktop\RAPIDPRO\rapidpro\env\lib\site-packages\dj
ango\core\management\__init__.py", line 377, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "C:\Users\syed.zakriya\Desktop\RAPIDPRO\rapidpro\env\lib\site-packages\dj
ango\core\management\base.py", line 288, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "C:\Users\syed.zakriya\Desktop\RAPIDPRO\rapidpro\env\lib\site-packages\dj
ango\core\management\base.py", line 338, in execute
    output = self.handle(*args, **options)
  File "C:\Users\syed.zakriya\Desktop\RAPIDPRO\rapidpro\env\lib\site-packages\dj
ango\core\management\base.py", line 533, in handle
    return self.handle_noargs(**options)
  File "C:\Users\syed.zakriya\Desktop\RAPIDPRO\rapidpro\env\lib\site-packages\dj
ango\core\management\commands\syncdb.py", line 27, in handle_noargs
    call_command("migrate", **options)
  File "C:\Users\syed.zakriya\Desktop\RAPIDPRO\rapidpro\env\lib\site-packages\dj
ango\core\management\__init__.py", line 115, in call_command
    return klass.execute(*args, **defaults)
  File "C:\Users\syed.zakriya\Desktop\RAPIDPRO\rapidpro\env\lib\site-packages\dj
ango\core\management\base.py", line 338, in execute
    output = self.handle(*args, **options)
  File "C:\Users\syed.zakriya\Desktop\RAPIDPRO\rapidpro\env\lib\site-packages\dj
ango\core\management\commands\migrate.py", line 63, in handle
    executor = MigrationExecutor(connection, self.migration_progress_callback)
  File "C:\Users\syed.zakriya\Desktop\RAPIDPRO\rapidpro\env\lib\site-packages\dj
ango\db\migrations\executor.py", line 17, in __init__
    self.loader = MigrationLoader(self.connection)
  File "C:\Users\syed.zakriya\Desktop\RAPIDPRO\rapidpro\env\lib\site-packages\dj
ango\db\migrations\loader.py", line 48, in __init__
    self.build_graph()
  File "C:\Users\syed.zakriya\Desktop\RAPIDPRO\rapidpro\env\lib\site-packages\dj
ango\db\migrations\loader.py", line 179, in build_graph
    self.applied_migrations = recorder.applied_migrations()
  File "C:\Users\syed.zakriya\Desktop\RAPIDPRO\rapidpro\env\lib\site-packages\dj
ango\db\migrations\recorder.py", line 59, in applied_migrations
    self.ensure_schema()
  File "C:\Users\syed.zakriya\Desktop\RAPIDPRO\rapidpro\env\lib\site-packages\dj
ango\db\migrations\recorder.py", line 49, in ensure_schema
    if self.Migration._meta.db_table in self.connection.introspection.get_table_
list(self.connection.cursor()):
  File "C:\Users\syed.zakriya\Desktop\RAPIDPRO\rapidpro\env\lib\site-packages\dj
ango\db\backends\__init__.py", line 165, in cursor
    cursor = self.make_debug_cursor(self._cursor())
  File "C:\Users\syed.zakriya\Desktop\RAPIDPRO\rapidpro\env\lib\site-packages\dj
ango\db\backends\__init__.py", line 138, in _cursor
    self.ensure_connection()
  File "C:\Users\syed.zakriya\Desktop\RAPIDPRO\rapidpro\env\lib\site-packages\dj
ango\db\backends\__init__.py", line 133, in ensure_connection
    self.connect()
  File "C:\Users\syed.zakriya\Desktop\RAPIDPRO\rapidpro\env\lib\site-packages\dj
ango\db\utils.py", line 94, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "C:\Users\syed.zakriya\Desktop\RAPIDPRO\rapidpro\env\lib\site-packages\dj
ango\db\backends\__init__.py", line 133, in ensure_connection
    self.connect()
  File "C:\Users\syed.zakriya\Desktop\RAPIDPRO\rapidpro\env\lib\site-packages\dj
ango\db\backends\__init__.py", line 122, in connect
    self.connection = self.get_new_connection(conn_params)
  File "C:\Users\syed.zakriya\Desktop\RAPIDPRO\rapidpro\env\lib\site-packages\dj
ango\db\backends\postgresql_psycopg2\base.py", line 134, in get_new_connection
    return Database.connect(**conn_params)
  File "C:\Users\syed.zakriya\Desktop\RAPIDPRO\rapidpro\env\lib\site-packages\ps
ycopg2\__init__.py", line 164, in connect
    conn = _connect(dsn, connection_factory=connection_factory, async=async)
django.db.utils.OperationalError: FATAL:  password authentication failed for use
r "temba"


Any idea on this??

Regards,
Syed

Nic Pottier

unread,
Feb 16, 2015, 11:54:36 AM2/16/15
to Syed Zakriya, rapi...@googlegroups.com
Looks like you don't have a user "temba" which has the right username
and password for the database in your settings.py.

You'll need to create that user and database in Postgres. (make sure
to load the extensions as detailed in the startup guide for that
database as well)

-Nic

On Mon, Feb 16, 2015 at 4:37 AM, Syed Zakriya

Kabi Pokotho

unread,
Jul 17, 2022, 1:05:47 PM7/17/22
to rapidpro
Hi Everyone,

Can anyone tell me where to finds this settings.py file,
I am getting the same error when trying to start  rp-indexer, I think. 
I am new to RapidPro Development 

ERRO[0000] error reaching ES                             error="<nil>" method=GET request="[]" response="{\"error\":{\"root_cause\":[{\"type\":\"index_not_found_exception\",\"reason\":\"no such index [contacts]\",\"resource.type\":\"index_or_alias\",\"resource.id\":\"contacts\",\"index_uuid\":\"_na_\",\"index\":\"contacts\"}],\"type\":\"index_not_found_exception\",\"reason\":\"no such index [contacts]\",\"resource.type\":\"index_or_alias\",\"resource.id\":\"contacts\",\"index_uuid\":\"_na_\",\"index\":\"contacts\"},\"status\":404}" status=404 url="http://localhost:9200/contacts"
INFO[0000] created index                                 index=contacts_2022_07_17_18
INFO[0000] created new physical index                    index=contacts physicalIndex=contacts_2022_07_17_18
INFO[0000] indexing contacts newer than last modified    index=contacts_2022_07_17_18 last_modified="0001-01-01 00:00:00 +0000 UTC"
ERRO[0000] error indexing contacts                       error="pq: password authentication failed for user \"kabi\""
Reply all
Reply to author
Forward
0 new messages