Tuesday, 1 September 2015

NotImplementedError: passwd.pw_passwd unimplemented

 When I try to install robotframework to use with jython, first I need to install jython. But when I try to install it an AWS Ubuntu machine, I encountered with an error like:
$ java -jar jython-installer-2.7.0.jar --type standard --silent --directory ~/jython
Performing silent installation
 10 %
 20 %
 30 %
 40 %
 50 %
 60 %
 70 %
Generating start scripts ...
Installing pip and setuptools
 90 %
Traceback (most recent call last):
  File "/home/ubuntu/jython/Lib/runpy.py", line 161, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/ubuntu/jython/Lib/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/ubuntu/jython/Lib/ensurepip/__main__.py", line 4, in 
  File "/home/ubuntu/jython/Lib/ensurepip/__init__.py", line 220, in _main
  File "/home/ubuntu/jython/Lib/ensurepip/__init__.py", line 123, in bootstrap
    _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
  File "/home/ubuntu/jython/Lib/ensurepip/__init__.py", line 45, in _run_pip
    import pip
  File "/tmp/tmp5_zLdP/pip-1.6-py2.py3-none-any.whl/pip/__init__.py", line 10, in 
  File "/tmp/tmp5_zLdP/pip-1.6-py2.py3-none-any.whl/pip/util.py", line 17, in 
  File "/tmp/tmp5_zLdP/pip-1.6-py2.py3-none-any.whl/pip/locations.py", line 109, in 
  File "/tmp/tmp5_zLdP/pip-1.6-py2.py3-none-any.whl/pip/locations.py", line 71, in _get_build_prefix
  File "/tmp/tmp5_zLdP/pip-1.6-py2.py3-none-any.whl/pip/locations.py", line 66, in __get_username
  File "/home/ubuntu/jython/Lib/pwd.py", line 60, in getpwuid
    return struct_passwd(entry)
  File "/home/ubuntu/jython/Lib/pwd.py", line 36, in __new__
    pwd = (newStringOrUnicode(pwd.loginName), newStringOrUnicode(pwd.password), int(pwd.UID),
NotImplementedError: passwd.pw_passwd unimplemented
 100 %
Congratulations! You successfully installed Jython 2.7.0 to directory /home/ubuntu/jython.

Although jython binary installed successfully, there was no pip or setuptools installation which I need for robotframework.

So I downloaded file http://peak.telecommunity.com/dist/ez_setup.py and run:
$ ./jython ez_setup.py

That installed easy_install to same folder as jython. So with:
$ ./easy_install robotframework

I could install robotframework and jybot.

Actually that is not a solution for the error at title but you can also install pip with:
$ ./easy_install pip

So far that solved my problem and I hope it solves someone else's too.

Friday, 21 August 2015

How can I see/list all all record in Elasticsearch?

Lucene syntax:

Elasticsearch recommended:
curl -XGET 'localhost:9200/foo/_search?search_type=scan&scroll=10m&size=50' -d '
    "query" : {
        "match_all" : {}