Problem with paths on Win 9x
Lexy Zhitenev
zhitenev at cs.vsu.ru
Mon Nov 25 12:19:57 EST 2002
> I'm trying to invoke a package, and I'm not getting very far.
> C:\Python22\MyStuff\AstroPy3>python fit\FileRunner.py CivilDateAT.htm
CivATOut.htm
> C:\PYTHON22\PYTHON.EXE: can't open file 'fit\FileRunner.py'
> ...
> The path to FileRunner.py is:
>
> c:\Python22\Lib\site-packages\fit\fit\FileRunner.py
>
Probably, you have forgotten one 'fit' dir. Your running path should look:
C:\Python22\MyStuff\AstroPy3>python fit\fit\FileRunner.py CivilDateAT.htm
CivATOut.htm
or
C:\Python22\MyStuff\AstroPy3\fit>python fit\FileRunner.py CivilDateAT.htm
CivATOut.htm
Also, your package should meet certain requirements:
1) it must have __init__.py in its dir.
2) it must be a subdir of your running script or be present in your sys.path
ALL subpackages should have a __init__.py file.
If you wish to run your script from a package, you have to create a 'run'
script, something like
#!/usr/bin/env python
import fit
fit.fit.FileRunner.main()
or something like that.
Good Luck!
Lexy.
More information about the Python-list
mailing list