I am trying to install OpenCV+Python on Mac. I am trying to do this in six steps by running commands at terminal (after step2):
Step1: Install Xcode
Step2: Install Homebrew
Step3: Install Python2 and Python3
1) brew install python python3
2) brew linkapps python
brew linkapps python3
4) which python
which python3
Step4: Install Python libraries by installing a virtual environment
Step5: Install OpenCV
Step6: Symlink OpenCV+Python to virtual environment
The problem is that which python must give output /usr/local/bin/python and not /usr/bin/python as it gives by default so that the virtual environment can be installed to install then the Python libraries.
I removed the link by running unlink /usr/bin/python and I created a symlink by running ln -s /usr/local/Cellar/python /usr/bin/python (python and python3 are installed by default at /usr/local/Cellar/).
However now which python gives me no output even though I have created the symlink. Why is this?
How can I change the output of which command to install finally OpenCV+Python on Mac?
Any better idea to install OpenCV+Python on Mac with most of the useful libraries or virtual environments etc? (Obviously I know how to do the installation without all these)
P.S. I followed this link: https://www.learnopencv.com/install-opencv3-on-macos/
which pythongives you not output, that meanspythonexecutable is not present within directories listed in your PATH variable. So the order doesn't matter. Also on Step 4 why are you stating that python must necessarily be pointed at /usr/local/bin/python?source /usr/local/bin/virtualenvwrapper.shcannot be executed at the bash_profile. Also if python points at at /usr/local/bin/python then it means that I am using the system version and not the homebrew version.