0

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

1
  • by changing PYTHONPATH it will still have those libraries in PYTHONPATH. Commented May 24, 2012 at 18:11

1 Answer 1

2

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!

Sign up to request clarification or add additional context in comments.

1 Comment

Is it possible without installing virualenv and without recompiling python, like by making some changes to search module of python or site.py

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.