Friday, April 29, 2011

Setting up PYTHONPATH in unix like platforms

Edit the .profile file inside your home directory and add a line somewhere to export your PYTHONPATH. A sample .profile file my mac is as shown below;

export PATH=/opt/local/bin:/opt/local/sbin:$PATH
export PYTHONPATH="/Users/kailash/pythonworks/"

After saving the .profile file, the commands just added must be read and executed by the system. For that source command comes handy.

$ source .profile

That's it, hopefully you will be able to import modules inside your python path permanently.

0 comments:

Post a Comment