Skip to content

dbshell_plus does not use virtualenv mycli and pygments, defaults to system version #4

@jontsai

Description

@jontsai

In my Django application, when I launch dbshell_plus, it seems to use the system mycli and not the one in virtualenv. When I uninstall the system mycli, a regular mysql client is started.

Additionally, dbshell_plus does not respect the mycli and Pygments in the virtualenv.

$ venv/bin/python manage.py dbshell_plus
Traceback (most recent call last):
  File "/usr/local/bin/mycli", line 7, in <module>
    from mycli.main import cli
  File "/usr/local/lib/python2.7/dist-packages/mycli/main.py", line 44, in <module>
    from .lexer import MyCliLexer
  File "/usr/local/lib/python2.7/dist-packages/mycli/lexer.py", line 1, in <module>
    from pygments.lexer import inherit
ImportError: cannot import name inherit

The issue is here:

The subprocess.call is invoked with args, which naively just uses pgcli or mycli, but does not detect whether it should use the path in virtualenv or not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions