On Friday 07 January 2005 20:15, Angus Leeming wrote: > > Ok, that's reasonable too. Do we need PYTHON_PATH as well, for lyx2lyx? > > Incidentally, José, I understand that Windows users are having difficulty > launching lyx2lyx because it doesn't have a ".py" extension and because > Windows doesn't search the first line of the script for > "#! /bin/env python"
What do you suggest? > See this snippet of a conversation I've been having with > Enrico Forestieri. > > >> >> In 1.3.5 something changed and the spawned program cannot be a > >> >> script but must be an executable. > > > > Actually, I don't think that's correct. All that has changed is that > > the type of the script "sh", "python", etc, is no longer hard-coded > > into LyX. > > Oh! Now I understand what was going on: before 1.3.5 the interpreter was > part of the invocation. I think that this broke many things in the native > win port as the "#! /path/to/interpreter" semantic seems not to be > followed. > Indeed, I noticed that the lyx2lyx script is not recognized as an > executable (it's not a matter of 'chmod +x ...'), so lyxwin is not able > to load older formats. I checked that this was also true in 1.3.3. > However, a simple wrapper written in C does the job, but using the cygwin > python and not the one bundled with lyxwin which seems to be unusable. > > > Try changing this line in your lyxrc.defaults file (you can > > do it from the Preferences dialog, where it will be saved in the > > $HOME/.lyx/preferences file): > > > > \converter lyxpreview ppm "lyxpreview2ppm.py" "" > > > > to > > > > \converter lyxpreview ppm "python $$s/lyxpreview2ppm.py" "" > > > > ($$s is a placeholder that will be replaced with the path to the > > script directory.) The other option would be to understand that the we are talking about a python script and call it from inside the scripts directory. I know that the code then becomes too clever but I don't have any easy solution for a multi-plantform installation. > That would be nice and would relief the need for C wrappers in lyxwin, > but I am sorry it does not work neither in linux nor in windows. In both, > what I get is this error message: > > python: can't open file '$$s/lyxpreview2ppm.py' > > However, it works replacing $$s with the actual path to the scripts dir, > but I don't think this would be acceptable for an average user. Anyway, > in windows, the cygwin python must be used, as the bundled one gives: > > 'import site' failed; use -v for traceback > Traceback (most recent call last): > File "C:/Programs/lyx/share/lyx/scripts/lyxpreview2ppm.py", line 50, in > ? import glob, os, re, string, sys > ImportError: No module named glob This is a symptom of a bad installation, as the python doesn't know the location of the standard directory. -- José Abílio