[Tutor] sys.path.append import python3 not working
Dave Angel
davea at davea.name
Wed Feb 5 12:32:46 CET 2014
Ian D <duxbuz at hotmail.com> Wrote in message:
>
> import sys
> sys.path.append("d:\modules")
Â
> I have tried it with append("d:\\modules") append("d:/\modules")
Â
The first form is not reasonable, you'd need to double the
backslash. But your second try should have worked. Here's what I
would use:
"d:/modules"
or perhaps
r"d:\modules"
"d:\\modules"
I would suggest printing sys.path from your code, just in case.
I would then check the actual directory name and module name,
especially for case. Windows may not usually care about case, but
sometimes it does matter.
Finally I'd run the python with the -v switch, and see what it
tells you.
--
DaveA
More information about the Tutor
mailing list