I have two python installation. One is installed in default location and other is installed in my home directory. I am using home directory python installation. I am facing problem about pythonpath. When I run sys.path on 2nd python installation it gives me paths for libraries of default python installation
eg.
2nd python is installed in /home/python2.6.1
now when i use sys.path it gives me
/lib/python2.6/lib-old, /lib/python2.6/lib-dynload etc.
instead of
/home/python2.6.1/lib/python2.6/lib-old, /home/python2.6.1/lib/python2.6/lib-dynload
how can I change path for my python installation in home directory
-
by changing PYTHONPATH it will still have those libraries in PYTHONPATH.big– big2012年05月24日 18:11:02 +00:00Commented May 24, 2012 at 18:11
1 Answer 1
This is because your libraries are installed in /lib or the interpreter has been configured to scan /lib for libraries. You need to recompile Python and give the configure script another prefix for the libraries.
But, this isn't what I would do. I'd install virtualenv and start managing my Python versions that way. This is what I do actually ;) Clean and simple!