On 2009-11-12, Uwe Stöhr wrote:
> Alex Fernandez schrieb:

>> Sure. It doesn't work because it tries to run eLyXer as a script, and
>> the script is nowhere to be found. On my Debian machine:
>>   $ python -tt elyxer
>>   python: can't open file 'elyxer': [Errno 2] No such file or directory

> I guess the python executable is in the PATH on Linux and the same
> applies for eLyXer when it was installed as Debian-package.

Of course, eLyXer is in the PATH. However, PATH is for executables,
i.e. it works if you simply call `elyxer` or `elyxer.py`.

So, please replace "python -tt elyxer" with "elyxer"!

Under Unix, this will 

* look for elyxer (respectively elyxer.py) in the binary PATH,
* look at the first bytes of the file, finding the magic string
    #! /usr/bin/env python
* pass the script to the python executable.

(For practical purposes, this is comparable to the action on Windows if
you click on the script in the Explorer -- it is started with the
associated program.)

> I must admit that I still don't understand why a python script like
> elyxer cannot be run by calling Python. 

Of course it can be run by calling Python. However, it will not be searched
along the PATH by Python. 

This is why the recommended way to run it under Python is to install it
in the Python Module Search Path and call it with "python -m elyxer".

Günter

Reply via email to