EDIT: Works for root, sudo is the problem. Read below.
I have a directory with my own libraries, e.g. my Python libraries are located at /home/name/lib/py
This should probably be posted somewhere else. But sudo will not process the environment file by default. If you want to invoke that the -i flag should help you out. It will simulate that users initial login.
You may have to play around with where you're putting your variables too. http://linux.die.net/man/8/sudo