Your problem is almost certainly because OH runs as the openhab user, not your login user.
Edit:
Also see
http://www.toptechboy.com/raspberry-pi/raspberry-pi-lesson-27-analog-voltages-using-gpio-pwm-in-python/