[Tutor] import question

Jacob S. keridee at jayco.net
Sat Jan 8 03:37:05 CET 2005


> It should work as you describe it.
> Can you just clarify how you are doing this?
> Are you setting sys.path in the same program you
> are trying to run? Or is it set in a Python startup script?
>
> How do you run a.py? Are you importing it into an existing
> Python session(with sys.path set or are you ruinning the
> file standalone?
>
> Basically the only thing I can think of is that your setting
> of sys.path isn't being seen.
>
> Can you put a debug print statement to display sys.path
> just before the import b statement? That way we make
> absolutely certain Pythoncan see the folder.
>
> Alan G.

I had some similar trouble with site-packages when I tried to install psyco
a little while ago. Apparently, the sys.path does not include sub folders of
site-packages more than one branch deep. I fixed it by moving the main
module folder up into the site-package folder. IOW, from
C:\python24\lib\site-packages\psyco-1.3\psyco to
C:\python24\lib\site-packages\psyco. And then it worked! So maybe Ryan has
to specify the exact folder?

HTH,
Jacob Schmidt



More information about the Tutor mailing list