Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am using python 2.7 in Mac OS X (10.7).

I have been trying to install OpenCV, but to no avail. In one attempt to get OpenCV to install properly I tried the MacPorts version of OpenCV, and I switched the python link to the MacPorts version using the command sudo port select --set python. However, I really would like to keep the python command to link to /usr/bin/python instead of its current link of /opt/local/bin/python.

By the way, why are the commands shown below output different results?

Unknown:~ jake$ which python
/opt/local/bin/python
Unknown:~ jake$ whereis python

EDIT

doesn't port select give you some other options?

Thank you for the suggestion.

Latest attempt:

$ port select python
Available versions for python:
    none
    python25-apple
    python26-apple
    python27 (active)
    python27-apple
$ port select python27-apple
Warning: Unable to get active selected version: The specified group 'python27-apple' does not exist.
Error: The 'list' command failed: The specified group 'python27-apple' does not exist.

I wasn't using the apple version (I believe apple only provided 2.6). However, I got the python that I was previously using from python.org. So, I am not sure what command with port select python I am supposed to use to switch to that version.

Thank you slhck for you help and suggestions.

share|improve this question
2  
Because whereis and which use different paths for searching. Check man whereis and man which respectively. –  slhck Nov 9 '12 at 17:52
3  
Regarding your problem: Can't you just switch it back? What specifically fails when installing OpenCV? Can you include error messages, logs, etc? –  slhck Nov 9 '12 at 17:53
    
AFAIK both the Xcode and MacPorts methods for installing give you no other option than '/opt/local/bin/' for the opencv_xxxx utilities as this is necessary to conform to MacPorts conventions. I could be wrong. –  Snesticle Nov 9 '12 at 18:41
    
@slhck "Can't you just switch it back?" What is the command for that. As for OpenCV errors, I wanted to keep working on that for a while to before I post questions about it. I just needed to fix my python path in the mean time since I have more important projects I need to work on that rely on the old packages. But thanks for the support, I might post that as another question soon enough. –  jakebird451 Nov 9 '12 at 19:06
1  
I have never worked with MacPorts, so I'm not entirely sure how exactly the command works, but doesn't port select give you some other options? Or port select list python? –  slhck Nov 9 '12 at 19:12

1 Answer 1

sudo port select python python27-apple

should do it.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.