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.
In my Django application, when I launch
dbshell_plus, it seems to use the systemmycliand not the one in virtualenv. When I uninstall the systemmycli, a regularmysqlclient is started.Additionally,
dbshell_plusdoes not respect themycliandPygmentsin the virtualenv.The issue is here:
django-dbshell-plus/lib/django_dbshell_plus/management/commands/dbshell_plus.py
Line 67 in ff2e810
The
subprocess.callis invoked withargs, which naively just usespgcliormycli, but does not detect whether it should use the path in virtualenv or not.