Error while running the python script provided on github link (the one with miniLinq query)

Hi all,

I am getting following error message while running the python script with
miniLinq queries. If any one have any idea about this problem please reply
me its urgent

Traceback (most recent call last):
File "comm.py", line 3, in
from commcare_export.minilinq import *
File
"/home/ganesh1238/commcare-export-master/commcare_export/init.py", line
1, in
from .version import version
File
"/home/ganesh1238/commcare-export-master/commcare_export/version.py", line
21, in
version = stored_version() or git_version()
File
"/home/ganesh1238/commcare-export-master/commcare_export/version.py", line
18, in git_version
described_version_bytes = subprocess.Popen(['git', 'describe'],
stdout=subprocess.PIPE).communicate()[0].strip()
File "/usr/lib/python2.7/subprocess.py", line 710, in init
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory

Thanks in advance.

Hi

Please could you send the actual command you ran on the command line. Also
could you provide the link to the script you are running.

Thanks
Simon

··· On 22 July 2014 14:34, Ganesh Ghongane wrote:

Hi all,

I am getting following error message while running the python script with
miniLinq queries. If any one have any idea about this problem please reply
me its urgent

Traceback (most recent call last):
File "comm.py", line 3, in
from commcare_export.minilinq import *
File
"/home/ganesh1238/commcare-export-master/commcare_export/init.py", line
1, in
from .version import version
File
"/home/ganesh1238/commcare-export-master/commcare_export/version.py", line
21, in
version = stored_version() or git_version()
File
"/home/ganesh1238/commcare-export-master/commcare_export/version.py", line
18, in git_version
described_version_bytes = subprocess.Popen(['git', 'describe'],
stdout=subprocess.PIPE).communicate()[0].strip()
File "/usr/lib/python2.7/subprocess.py", line 710, in init
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory

Thanks in advance.

--


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

--
Simon Kelly
Senior Engineer | Dimagi South Africa

Hi Simon,

Thanks for the reply.

The script I am using it from the link

Note: I changed the json query to as per my requirement to export data.
and command used to run is python filename.py

I managed to resolve the above reported problem.
But now I am facing some another problem with the same script.
The I am getting is copied below ( I guess it is something related to
function emitted_tables() from env.py file)

Traceback (most recent call last):
File "comm.py", line 59, in
if len(list(env.emitted_tables())) > 0:
File "/usr/local/lib/python2.7/dist-packages/commcare_export/env.py",
line 77, in emitted_tables

  • raise NotImplementedError()*
    NotImplementedError

Do I need to implement this function ?

Many thanks in advance.

Best
Ganesh

··· On Tuesday, July 22, 2014 7:21:21 PM UTC+5:30, skelly wrote: > > Hi > > Please could you send the actual command you ran on the command line. Also > could you provide the link to the script you are running. > > Thanks > Simon > > > On 22 July 2014 14:34, Ganesh Ghongane <ganes...@iiitd.ac.in wrote: > >> Hi all, >> >> >> I am getting following error message while running the python script with >> miniLinq queries. If any one have any idea about this problem please reply >> me its urgent >> >> >> Traceback (most recent call last): >> File "comm.py", line 3, in >> from commcare_export.minilinq import * >> File >> "/home/ganesh1238/commcare-export-master/commcare_export/__init__.py", line >> 1, in >> from .version import __version__ >> File >> "/home/ganesh1238/commcare-export-master/commcare_export/version.py", line >> 21, in >> __version__ = stored_version() or git_version() >> File >> "/home/ganesh1238/commcare-export-master/commcare_export/version.py", line >> 18, in git_version >> described_version_bytes = subprocess.Popen(['git', 'describe'], >> stdout=subprocess.PIPE).communicate()[0].strip() >> File "/usr/lib/python2.7/subprocess.py", line 710, in __init__ >> errread, errwrite) >> File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child >> raise child_exception >> OSError: [Errno 2] No such file or directory >> >> Thanks in advance. >> >> >> -- >> >> --- >> You received this message because you are subscribed to the Google Groups >> "CommCare Developers" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to commcare-developers+unsubscribe@googlegroups.com . >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Simon Kelly > Senior Engineer | Dimagi South Africa >

Hi Ganesh,

··· On 30/07/2014 12:01, Ganesh Ghongane wrote: > Traceback (most recent call last): > File "comm.py", line 59, in > if len(list(env.emitted_tables())) > 0: > File "/usr/local/lib/python2.7/dist-packages/commcare_export/env.py", > line 77, in emitted_tables > * raise NotImplementedError()* > NotImplementedError > > Do I need to implement this function ?

I am not familiar with this script, but it seems like your env object is
a direct instance of env.Env
This class is "virtual", in a sense that it just exposes an interface
but the methods are not actually implemented, hence the
NotImplementedError() exception

Depending of what you need to do I suggest you use one of the concrete
classes of the env.py module : DictEnv, JsonPathEnv or more probably
BuiltInEnv

Hope this is useful,

--
Charles Flèche
mHealth advisor
Télécoms Sans Frontières http://www.tsfi.org
Première Urgence - Aide Médicale Internationale http://www.pu-ami.org
+95 9 431 978 25
Skype: charles.fleche

Hi Ganesh

I'm still unsure which 'script' you are running. I would recommend you use
one of the released version of commcare-export which you can install with
the following command:

pip install commcare-export

There is further documentation on using the tool here:
https://confluence.dimagi.com/display/commcarepublic/CommCare+Data+Export+Tool

If your use case isn't covered and you really need to use the python API
directly then I would recommend looking at the 'cli.py' file which handles
the command line execution and will give you an idea of how the API works.
There are also some examples in the README.md file which gives some basic
usage examples.

If you would like assistance with the python API then it would be very
helpful to see the code you are trying to execute.

Best regards
Simon

··· On 30 July 2014 11:26, Charles Flèche wrote:

Hi Ganesh,

On 30/07/2014 12:01, Ganesh Ghongane wrote:

Traceback (most recent call last):
File "comm.py", line 59, in
if len(list(env.emitted_tables())) > 0:
File "/usr/local/lib/python2.7/dist-packages/commcare_export/env.py",
line 77, in emitted_tables

  • raise NotImplementedError()*

NotImplementedError

Do I need to implement this function ?

I am not familiar with this script, but it seems like your env object is a
direct instance of env.Env
This class is "virtual", in a sense that it just exposes an interface but
the methods are not actually implemented, hence the NotImplementedError()
exception

Depending of what you need to do I suggest you use one of the concrete
classes of the env.py module : DictEnv, JsonPathEnv or more probably
BuiltInEnv

Hope this is useful,

--
Charles Flèche
mHealth advisor
Télécoms Sans Frontières http://www.tsfi.org
Première Urgence - Aide Médicale Internationale http://www.pu-ami.org
+95 9 431 978 25
Skype: charles.fleche

--

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

--
Simon Kelly
Senior Engineer | Dimagi South Africa