osx - Error Installing OpenCV with Python on OS X -


i have been trying install open cv 3 on mac using tutorial cannot past step three.

so after

brew install python 

i

nano ~/.bash_profile 

and @ bottom of script paste

# homebrew export path=/usr/local/bin:$path 

after reload file

source ~/.bash_profile 

finally check python this

which python 

and prints

/usr/bin/python 

instead of

/usr/local/bin/python 

i have tried edited file in textedit has same result.

am doing wrong or bad tutorial?

thank in advance!

edit:

# setting path python 3.5 # orginal version saved in .bash_profile.pysave path="/library/frameworks/python.framework/versions/3.5/bin:${path}" export path  ## # previous /users/username/.bash_profile file backed /users/username/.bash_profile.macports-saved_2016-07-26_at_12:50:19 ##  # macports installer addition on 2016-07-26_at_12:50:19: adding appropriate path variable use macports. export path="/opt/local/bin:/opt/local/sbin:$path" # finished adapting path environment variable use macports. # homebrew export path=/usr/local/bin:$path 

pydoc3.5 python3 python3-32 python3-config python3.5 python3.5-32 python3.5-config python3.5m python3.5m-config

is there

/usr/local/cellar/python/2.7.12/ 

directory? (version number might differ.)

is there

/usr/local/bin/python 

file?

if cellar directory present, file isn't, homebrew decided careful , not put python in /usr/local/bin/ immediately.
manually do

brew link python 

and see if there's a

/usr/local/bin/python 

file.


in case, appears have files related python (they might python 3 installation, can't tell), such 2to3. can safely overwrite them, since python 2 has this. thus:

brew link --overwrite python 

is fine.

note:

specific python versions exist python2.7, python3.5 etc (including full path necessary). thus, overwriting python executable safe (provided it's not system 1 in /usr/bin): should explicit python executable use.

also, when using tool pip, can make sure you're using correct version running e.g.

/usr/local/bin/pythnon2.7 -m pip <...> 

or whatever python executable want install things for.


Comments