*Run python from the command line:*
Python 2.6.4 (r264:75706, Dec  7 2009, 18:43:55)
[GCC 4.4.1] on linux2
I tried running 2+2; and that worked.
*Run /usr/lib/python2.6$ python site.py from the command line:*
sys.path = [
    '/usr/lib/python2.6',
    '/usr/lib/python2.6/plat-linux2',
    '/usr/lib/python2.6/lib-tk',
    '/usr/lib/python2.6/lib-old',
    '/usr/lib/python2.6/lib-dynload',
    '/usr/lib/python2.6/dist-packages',
    '/usr/lib/python2.6/dist-packages/Numeric',
    '/usr/lib/python2.6/dist-packages/PIL',
    '/usr/lib/python2.6/dist-packages/gst-0.10',
    '/usr/lib/pymodules/python2.6',
    '/usr/lib/python2.6/dist-packages/gtk-2.0',
    '/usr/lib/pymodules/python2.6/gtk-2.0',
    '/usr/lib/python2.6/dist-packages/wx-2.6-gtk2-unicode',
    '/usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode',
    '/usr/local/lib/python2.6/dist-packages',
]
USER_BASE: '/home/bkay/.local' (exists)
USER_SITE: '/home/bkay/.local/lib/python2.6/site-packages' (doesn't exist)
ENABLE_USER_SITE: True
*As far as I can tell I didn't have a PYTHONPATH. I added
PYTHONPATH=/usr/local/lib/python2.6 and export PYTHONPATH to my .bashrc and
got the same set of errors*

*I thought it may be a path or network drive problem in windows. When I run
tex2lyx on the command line on my windows box in the lyx bin directory I
get:*
C:\Program Files\LyX16\bin>tex2lyx latexexample.tex
Creating file C:/Program Files/LyX16/bin/latexexample.lyx
\end{document} does not match \begin{center}
\end{verbatim} does not match \begin{document}
\end{document} does not match \begin{verbatim}
Bug: Ignoring par-level extra stuff '\noindent
'

*Which generates a file I can open with lyx, which is good. I had been
running it from a network drive (using expandrive) and having trouble. I was
also able to confirm it worked from local "My Documents". It also worked in
lyx. I guess problem solved (or at least worked around) for windows.* *When
I run the command directly on the tex2lyx on the network drive file it also
works:*
C:\Program Files\LyX16\bin>tex2lyx -f "Z:\Documents\Macro\Predicting housing
prices with rates and risk\Latex_Output_for_Housing_Class_1.tex"
Creating file Z:/Documents/Macro/Predicting housing prices with rates and
risk/Latex_Output_for_Housing_Class_1.lyx
<then it returns to the command line and leaves the file>

*Then I thought it might be the spaces in the directory name in the path to
the latex source file. when I renamed the directory to
Predicting_housing_prices_with_rates_and_risk I got the same error, so I
think it is something else. *

*
So, to summarize. I can get tex2lyx to work and lyx to call it from windows
when working on a local drive but not a network drive. I cannot get tex2lyx
(or call it from lyx) from my linux machine (local only tried) . I have
verified that I have python installed, at leas superficially works, and also
added the PYTHONPATH shell parameter. *
_





On 2010-04-14,Guenter Milde wrote:
This looks very much like a broken Python installation.
The module "site.py" is a very basic one

python2.6-minimal: /usr/lib/python2.6/site.py

and should be found. Do you have a local Python installation?
What is the Python version and what is the PYTHONPATH



On 2010-04-14, Benjamin Kay wrote:

> I cannot import Latex code into Lyx using tex2lyx or using
> File-Import-Latex (plain).
...

> The error from the command line (tex2lyx -f
> Latex_Output_for_Housing_Class_1.tex tmp.lyx ) is more elaborate but no
> more helpful to me:

> 'import site' failed; use -v for traceback
> 'import site' failed; use -v for traceback
> Traceback (most recent call last):
> File "/usr/share/lyx/scripts/layout2layout.py", line 15, in <module>
> import os, re, string, sys
> File "/usr/lib/python2.6/os.py", line 49, in <module>
> import posixpath as path
> File "/usr/lib/python2.6/posixpath.py", line 16, in <module>
> import warnings
> File "/usr/lib/python2.6/warnings.py", line 6, in <module>
> import linecache
> ImportError: No module named linecache
> Could not run layout conversion script layout2layout.py.
> We failed to find the layout '' in the layout list. You MUST
> investigate!
> Segmentation fault




 #> python

   import sys
   sys.path

?

Do you get the same error on the Windows machine?




http://www.mail-archive.com/lyx-users@lists.lyx.org/
http://www.lyx.org/wiki/index.php/Web/MailingLists
-- 
Benjamin Kay

Reply via email to