Re: Support for xfig graphics

2022-06-21 Thread Steve Litt
José Abílio Matos said on Tue, 21 Jun 2022 17:29:48 +0100


>LyX is choosing python2 as the python version and since that python2
>does not work then the converters that use python fail.

That can't be right. Python 2 has been deprecated for years. I'm sure
LyX gives you the choice to use Python 3.

SteveT

Steve Litt 
March 2022 featured book: Making Mental Models: Advanced Edition
http://www.troubleshooters.com/mmm
-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: Conversion failure for older format

2022-06-21 Thread Rudi Gaelzer
On terça-feira, 21 de junho de 2022 13:27:12 -03 José Abílio Matos wrote:
> 
> This is problematic on so many levels. :-)
> Notice that your python2 is using python3's standard library and so the
> disaster is unavoidable.
> 
> Something is wrong with your python2 installation because that should not
> happen in a regular Fedora installation. I am not even sure if that could
> have been caused by setting PYTHONPATH...
> 
> I have just tested a similar call like the one above and it works for me.
> 
> One way to solve the problem in lyx is to install the
> python-unversioned-command package.
> That will make /usr/bin/python point to python3 because currently lyx is
> getting python2 as the python version and thus the error that you get. But
> again in this case this is just a workaround the problem that you have.
> 
> I hope that this helps.

There was indeed a conflict between two python distributions installed in my 
system: the distribution from Fedora and Intel python.  This is also related 
to my other thread (Support for xfig graphics).
I removed the intel distribution and now it seems that everything is working 
as it should.

Thank you.
-- 
Rudi Gaelzer
Physics Institute - UFRGS
BRAZIL
Registered Linux user # 153741



-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: Support for xfig graphics (Solved)

2022-06-21 Thread Rudi Gaelzer
On terça-feira, 21 de junho de 2022 14:26:39 -03 Rudi Gaelzer wrote:
> Indeed there is:
> 
> 14:20:04.072: Previewing ...
> 14:20:04.076: (buffer-view)
> 14:20:04.085: python -tt "/usr/share/lyx/scripts/fig_copy.py"
> "/home/rudi/temp/ ufrgs/Coulomb_Law.fig" "/tmp/lyx_tmpdir.DFELBfPgzbQo/
> lyx_tmpbuf25/40_home_rudi_temp_ufrgs_Coulomb_Law.fig"
> 14:20:04.104: Fatal Python error: init_sys_streams: can't initialize sys
> standard streams
> 
> There's a fatal error with python.  Is that it?
> I had to force the standard distribution for python in .bashrc with:
> alias python='/usr/bin/python3'
> otherwise the standard would fall to the Intel distribution.

It seems that the problem was indeed a mix-up with different python 
distributions.
Got rid of the Intel python distribution and now the internal conversion of 
Xfig files is working again.
-- 
Rudi Gaelzer
Physics Institute - UFRGS
BRAZIL
Registered Linux user # 153741



-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: Conversion failure for older format

2022-06-21 Thread José Abílio Matos
On Tuesday, 21 June 2022 17.06.00 WEST Jean-Marc Lasgouttes wrote:
> Are you sure that you do not have another file names "lyx2lyx"
> somewhere? "locate" may be able to determine that.
> 
> JMarc

It is unlikely because lyx always knows the relative location of lyx2lyx.
So even if there are two lyx2lyx in path each lyx versions always use the 
right version.

-- 
José Abílio-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: Conversion failure for older format

2022-06-21 Thread José Abílio Matos
On Tuesday, 21 June 2022 13.44.01 WEST Rudi Gaelzer wrote:
> Hits a snag right at the beginning:
> 
> rudi@stix|Plasma Modes>python2 /usr/share/lyx/lyx2lyx/lyx2lyx Langmuir-
> lyxformat-508.lyx > /dev/null
>   File "/usr/lib64/python3.10/site.py", line 93
> print(message, file=sys.stderr)
>^
> SyntaxError: invalid syntax

This is problematic on so many levels. :-)
Notice that your python2 is using python3's standard library and so the 
disaster is unavoidable.

Something is wrong with your python2 installation because that should not 
happen in a regular Fedora installation. I am not even sure if that could have 
been caused by setting PYTHONPATH...

I have just tested a similar call like the one above and it works for me.

One way to solve the problem in lyx is to install the 
python-unversioned-command package.
That will make /usr/bin/python point to python3 because currently lyx is 
getting python2 as the python version and thus the error that you get. But 
again in this case this is just a workaround the problem that you have.

I hope that this helps.
-- 
José Abílio-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: Support for xfig graphics

2022-06-21 Thread José Abílio Matos
On Tuesday, 21 June 2022 14.12.14 WEST Rudi Gaelzer wrote:
> It seems that the support for xfig figures is not working on my system.  See
> the attached files.
> The Xfig file sets the TeX flag for text.

I think that this could be a manifestation of the problem that you have.

LyX is choosing python2 as the python version and since that python2 does not 
work then the converters that use python fail.
-- 
José Abílio-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: Support for xfig graphics

2022-06-21 Thread Rudi Gaelzer
On terça-feira, 21 de junho de 2022 13:09:22 -03 Jean-Marc Lasgouttes wrote:
> Le 21/06/2022 à 15:12, Rudi Gaelzer a écrit :
> > Running:
> > Fedora Core 36 on x64 box
> > KDE Plasma Version: 5.24.5
> > LyX Version 2.3.6.1 (provided by Fedora repo)
> > 
> > It seems that the support for xfig figures is not working on my system. 
> > See the attached files.
> > The Xfig file sets the TeX flag for text.
> 
> Hi again,
> 
> Do you have "transfig" installed?

Affirmative.

> 
> Are there some relevant error messages in the Messages pane?
> 
> JMarc

Indeed there is:

14:20:04.072: Previewing ...
14:20:04.076: (buffer-view)
14:20:04.085: python -tt "/usr/share/lyx/scripts/fig_copy.py" "/home/rudi/temp/
ufrgs/Coulomb_Law.fig" "/tmp/lyx_tmpdir.DFELBfPgzbQo/
lyx_tmpbuf25/40_home_rudi_temp_ufrgs_Coulomb_Law.fig"
14:20:04.104: Fatal Python error: init_sys_streams: can't initialize sys 
standard streams
14:20:04.104: Python runtime state: core initialized
14:20:04.104: Traceback (most recent call last):
14:20:04.104:   File "/usr/lib64/python3.10/io.py", line 54, in 
14:20:04.105: ImportError: cannot import name 'text_encoding' from 'io' 
(unknown location)
14:20:04.117: pdflatex  "tes_xfig01.tex"
14:20:04.190: This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2021) 
(preloaded format=pdflatex)
14:20:04.190:  restricted \write18 enabled.
14:20:04.223: entering extended mode
14:20:04.223: (./tes_xfig01.tex
14:20:04.223: LaTeX2e <2020-10-01> patch level 4
14:20:04.226: L3 programming layer <2021-05-07>
Systemcall.cpp (276): Systemcall: 'python -tt "/usr/share/lyx/scripts/
fig_copy.py" "/home/rudi/temp/ufrgs/Coulomb_Law.fig" "/tmp/
lyx_tmpdir.DFELBfPgzbQo/lyx_tmpbuf25/40_home_rudi_temp_ufrgs_Coulomb_Law.fig"' 
finished with exit code 1
14:20:04.560: Error while exporting format: PDF (pdflatex)Systemcall.cpp (276): 
Systemcall: 'pdflatex  "tes_xfig01.tex"' finished with exit code 1
14:20:59.489: Automatic save done.
14:21:37.497: (dialog-toggle progress)

There's a fatal error with python.  Is that it?
I had to force the standard distribution for python in .bashrc with:
alias python='/usr/bin/python3'
otherwise the standard would fall to the Intel distribution.


-- 
Rudi Gaelzer
Instituto de Física
Departamento de Física
Universidade Federal do Rio Grande do Sul
Av. Bento Gonçalves, 9500
Caixa Postal 15051
91501-970 Porto Alegre - RS
Fone: (51) 3308-6474
FAX: (51) 3308-7286
Usuário de Linux registrado # 153741


-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: Support for xfig graphics

2022-06-21 Thread Jean-Marc Lasgouttes

Le 21/06/2022 à 15:12, Rudi Gaelzer a écrit :

Running:
Fedora Core 36 on x64 box
KDE Plasma Version: 5.24.5
LyX Version 2.3.6.1 (provided by Fedora repo)

It seems that the support for xfig figures is not working on my system.  See the
attached files.
The Xfig file sets the TeX flag for text.


Hi again,

Do you have "transfig" installed?

Are there some relevant error messages in the Messages pane?

JMarc

--
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: Conversion failure for older format

2022-06-21 Thread Jean-Marc Lasgouttes

Le 21/06/2022 à 14:39, Rudi Gaelzer a écrit :

lyx2lyx is a python script.  How do I verify the path for python scripts?
It is not in the paths for shell commands, listed by which.

According to dnf, the only package that provides lyx2lyx is
lyx-common-2.3.6.1-6.fc36.noarch


Are you sure that you do not have another file names "lyx2lyx" 
somewhere? "locate" may be able to determine that.


JMarc
--
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Support for xfig graphics

2022-06-21 Thread Rudi Gaelzer
Running:
Fedora Core 36 on x64 box
KDE Plasma Version: 5.24.5
LyX Version 2.3.6.1 (provided by Fedora repo)

It seems that the support for xfig figures is not working on my system.  See 
the 
attached files.
The Xfig file sets the TeX flag for text.

In the LyX window, the preview fails.  When I try to view the document with 
pdflatex, the following error message appears in the latex log:

! LaTeX Error: File `0_home_rudi_temp_ufrgs_Coulomb_Law.pdftex_t' not found.

Exporting to LaTeX (pdflatex) generates the attached file.  Running on terminal:
rudi@stix|ufrgs>pdflatex tes_xfig01.tex
gives the expected error:
! LaTeX Error: File `Coulomb_Law.pdftex_t' not found.
because the exporter did not generate the Coulomb_Law.pdftex_t file.

-- 
Rudi Gaelzer
Physics Institute - UFRGS
BRAZIL
Registered Linux user # 153741
%% LyX 2.3.6.1 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[brazil]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{color}
\usepackage{graphicx}

\makeatletter

%% LyX specific LaTeX commands.
%% A simple dot to overcome graphicx limitations
\newcommand{\lyxdot}{.}


\makeatother

\usepackage{babel}
\begin{document}
\begin{center}
\resizebox{0.7\textwidth}{!}{\input{Coulomb_Law.pdftex_t}}
\par\end{center}
\end{document}


tes_xfig01.lyx
Description: application/lyx
-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: Conversion failure for older format

2022-06-21 Thread Rudi Gaelzer
On segunda-feira, 20 de junho de 2022 13:44:47 -03 José Abílio Matos wrote:
> 
> If you still have the 508 format file could you run:
> 
> $ python2 /usr/share/lyx/lyx2lyx/lyx2lyx -lyxformat-508.lyx >
> /dev/null
> 
> The only difference from your command above is that this is running the
> converter using python2 and not python3 as it happens above.
> 
> For what is worth this will ignore the output because we are only interest
> in any error that can occur...
> 
> > I'm running the installation from the rpm packages distributed for Fedora
> > core 35/36.
> 
> I am using the same and I am the package maintainer for those packages. :-)

Hits a snag right at the beginning:

rudi@stix|Plasma Modes>python2 /usr/share/lyx/lyx2lyx/lyx2lyx Langmuir-
lyxformat-508.lyx > /dev/null
  File "/usr/lib64/python3.10/site.py", line 93
print(message, file=sys.stderr)
   ^
SyntaxError: invalid syntax

-- 
Rudi Gaelzer
Physics Institute - UFRGS
BRAZIL
Registered Linux user # 153741



-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: Conversion failure for older format

2022-06-21 Thread Rudi Gaelzer
On terça-feira, 21 de junho de 2022 07:06:28 -03 Jean-Marc Lasgouttes wrote:
> Le 20/06/2022 à 15:28, Rudi Gaelzer a écrit :
> > That successfully converted the original to format 544, which the frontend
> > was able to render.
> > Is it possible that there's a bug in the automagic process?
> > I'm running the installation from the rpm packages distributed for Fedora
> > core 35/36.
> 
> Could it be that you have another version of lyx2lyx on your path?
> 
> JMarc

lyx2lyx is a python script.  How do I verify the path for python scripts?  
It is not in the paths for shell commands, listed by which.

According to dnf, the only package that provides lyx2lyx is 
lyx-common-2.3.6.1-6.fc36.noarch

$>dnf provides */lyx2lyx
Last metadata expiration check: 23:33:59 ago on seg 20 jun 2022 10:00:57.
lyx-common-2.3.6.1-6.fc36.noarch : Common files of lyx
Repo: @System
Matched from:
Filename: /usr/share/lyx/lyx2lyx
Filename: /usr/share/lyx/lyx2lyx/lyx2lyx

lyx-common-2.3.6.1-6.fc36.noarch : Common files of lyx
Repo: fedora
Matched from:
Filename: /usr/share/lyx/lyx2lyx
Filename: /usr/share/lyx/lyx2lyx/lyx2lyx


-- 
Rudi Gaelzer
Physics Institute - UFRGS
BRAZIL
Registered Linux user # 153741



-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: Conversion failure for older format

2022-06-21 Thread Jean-Marc Lasgouttes

Le 20/06/2022 à 15:28, Rudi Gaelzer a écrit :

That successfully converted the original to format 544, which the frontend was
able to render.
Is it possible that there's a bug in the automagic process?
I'm running the installation from the rpm packages distributed for Fedora core
35/36.


Could it be that you have another version of lyx2lyx on your path?

JMarc
--
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users