1

I have two versions of Python 2.7.

Using pip-2.7 install bsddb3 seems to install bsddb3 for the native OS X version of Python.

How do I change it to the version of Python located at

/Library/Frameworks/Python.framework/Versions/7.3/Resources/Python.app/Contents/MacOS

(Found the path with >>> os.path.dirname(sys.executable) which might not be correct. *nix still confuses me.)

Note AFAICS this is not a duplicate. The other qs asks how to install for specific versions (e.g. 2.7 vs 2.6).

1
  • Yes, I wondered about that too, but that is where it was installed. Commented Nov 20, 2012 at 14:17

2 Answers 2

2

First, create a virtualenv pointing at the python you want, using something like virtualenv -p PYTHON_EXE VIRTUALENV_DIR. Then activate that virtualenv with source VIRTUALENV_DIR/bin/activate and then running pip will be isolated and use the python of that virtualenv.

If you don't use virtualenv, start :)

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

2 Comments

Accepting this tentatively even though installing virtualenv seems to open another bag of cans of worms.
virtualenv can just be a single python script you download and run, if you want to not install it in any way - pypi.python.org/pypi/virtualenv has the details.
0

doesn't running pip with the python to which you want to install the package like this works?

path/to/python path/to/pip install package_name

btw, why not create new virtualenv and use pip from there?

1 Comment

Any permutation of those did not work, but I might not have understood what you tried to do.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.