[Tutor] sys.path.append import python3 not working

Tim Golden mail at timgolden.me.uk
Wed Feb 5 12:51:18 CET 2014


On 05/02/2014 11:46, Ian D wrote:
> Ok even more strangely it is working in the original location.
>  
> Am now not 100% sure that I have the folder structure correct.
>  
> I will keep a eye on it.

You might want to consider whether your approach is the best. One
usually appends to sys.path when there's something dynamic about the
location of modules (eg for a plugin mechanism). If your library modules
are always in, say, d:/modules then just set up a PYTHONPATH env var
with that in it; or use a .pth file in your python directory. I do the
latter, altho' it's frowned upon by some for reasons I've never entirely
understood.

TJG



More information about the Tutor mailing list