On Sun, Jun 11, 2017 at 10:57:18PM +0200, Kornel Benko wrote:

> Am Sonntag, 11. Juni 2017 um 22:19:15, schrieb Enrico Forestieri 
> <for...@lyx.org>
> > On Sun, Jun 11, 2017 at 07:23:45PM +0200, Jürgen Spitzmüller wrote:
> > > Am Sonntag, den 11.06.2017, 18:32 +0200 schrieb Enrico Forestieri:
> > > > > I also think this widget should be disabled if not all necessary
> > > > > packages are installed.
> > > > 
> > > > This is problematic, because we should check for installed python
> > > > modules, which I don't think we currently do. 
> > > 
> > > This can be added to configure.py, no?
> > 
> > I see a further difficulty here. The pygments module could be installed
> > as a python 2 or python 3 module. The right python version to use is
> > determined by the used pygmentize command. So, if we are running python 2
> > and don't find the pygments module, it is not an indication that it is
> > not available. Conversely if we are running python 3 and pygments is
> > installed as a python 2 module.
> > 
> > Maybe, the only sensible thing to do is checking for a pygmentize command
> > and, if not found, warn the user but don't disable the widget.
> > 
> 
> Couldn't the test be as easy as to check output of
>       python -c "help('pygments');" 
> ?

Please, read more carefully what written above. In my case,
        python -c "help('pygments');"
gives the help, but
        python3 -c "help('pygments');"
produces:
No Python documentation found for 'pygments'.
Use help() to get the interactive help utility.
Use help(str) for help on the str class.

Only the driver command knows what python has to be used.

-- 
Enrico

Reply via email to