pgcli: pgcli get stuck indefinitely on Windows

I’m using Powershell on ConEmu to run pgcli after installing it via pip, and it just gets stuck when I run pgcli. Only pgcli --help outputs the help, nothing else works.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 21 (10 by maintainers)

Most upvoted comments

@kumarharsh This latest exception you’re seeing is due to a known bug that is fixed in master. Can you try upgrading directly from master using the following command?

pip install -U https://github.com/dbcli/pgcli/archive/master.zip

Works like a charm!

@darikg I got it working using @j-bennet’s suggestion:

$ docker-machine ip <my-machine>
output: 192.168.99.100

$ pgcli postgresql://<username>@192.168.99.100:5432/<my_db>

However, after I write the first word in the cli, say `SEL…<ENTER>’ to select the ‘SELECT’ keyword and then I press <kbd>Space</kbd>, there is an error thrown:

Traceback (most recent call last):
  File "c:\langs\python27\lib\threading.py", line 551, in __bootstrap_inner
    self.run()
  File "c:\langs\python27\lib\threading.py", line 504, in runode
    self.__target(*self.__args, **self.__kwargs)
  File "c:\langs\python27\lib\site-packages\prompt_toolkit\interface.py", line 836, in run
    completions = list(buffer.completer.get_completions(document, complete_event))
  File "c:\langs\python27\lib\site-packages\pgcli\pgcompleter.py", line 332, in get_completions
    suggestions = suggest_type(document.text, document.text_before_cursor)
  File "c:\langs\python27\lib\site-packages\pgcli\packages\sqlcompletion.py", line 115, in suggest_type
    return suggest_based_on_last_token(stmt.last_token, stmt)
  File "c:\langs\python27\lib\site-packages\pgcli\packages\sqlcompletion.py", line 247, in suggest_based_on_last_token
    token_v = token.value.lower()
AttributeError: 'tuple' object has no attribute 'value'

I can, however, keep writing the rest of the command. But the autocomplete breaks after that, and never triggers.