Python import search path

Kevin Zhang kevin.misc.10 at
Sat Aug 20 05:52:27 EDT 2011


This is the directory tree.
└── sme
    ├── src
    │   ├── a.pth
    │   ├──
    └── test

I need to import in

Found a few solution in python docs.
A. sys.path.append
B. add ***.pth file
C. edit .../site-packages/

I found out that a.pth only works when in directory like
instead of in current directory.

I think A is not so pretty, and I don't have root  privilege to use B and C.
So any both more elegant and practical solutions?

Kevin Zhang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list