Installation will ask you to append path to. Install anaconda, it creates a directory and install everything inside thatĪfter download, goto terminal and download location of anaconda. I'll share what I did: easy steps to install complete package opencv3, numpy, matplotlib, notebook, spyder etc. On top of that installing and linking all site-packages is little problematic and we end up with errors. Problem with Mac is Python 2.7 is already installed by Mac. Some links suggest for Brew and some virtual env, some say install xcode but all failed in my case.ĭont use linux steps to instal opencv-python on Mac. Just type : pip3 install opencv-python If you want a specific version Do : pip3 install opencv-pythonversion Then import it wherever you want to use it. I searched and tried installing opencv3 with python3 for 3 days. 3 Answers Sorted by: 2 You can install opencv using pip (probably pip3 if you are on a mac). D PYTHON_LIBRARY=/usr/local/Cellar/python/2.7.3/Frameworks/amework/Versions/2.7/lib/libpython2.7.dylib\ D PYTHON_INCLUDE_DIR=/usr/local/Cellar/python/2.7.3/Frameworks/amework/Headers\ D PYTHON_PACKAGES_PATH=$WORKON_HOME/opencv/lib/python2.7/site-packages \ cd OpenCV-2.4.3/Ĭmake -D PYTHON_EXECUTABLE=$WORKON_HOME/opencv/bin/python \ Use homebrew to get all the dependencies, but then download the OpenCV tarball and compile yourself being sure to specify all the python related configuration options.Īssuming a virtualenv named 'opencv'. I have collected most of my setup in a gist here: It was defaulting to the MacOS-installed version despite the fact that I had upgraded python with homebrew and was using a virtualenv for python. For me, the problem was that that OpenCV installer was not finding the right python installation. That should do the trick: having opencv working with python while still having all the scientific modules that you like.I spent a couple days on this myself. Comment out all other python versions and add the following line: export PATH=/opt/local/bin:/opt/local/sbin:$PATH You most likely have a reference to your Enthough version in there. Once it has opened just see if there are references to other python distro's. You can do this by editing your ~/.bash_profile like so: sudo open -t ~/.bash_profile Then do: sudo port install python27 # (or any other version you want)Īnd of course you can install any other packages you need: sudo port install py27-scipyįinally, you have to make sure that when typing "python" on the command line, it does refer to the version thatyou installed using macports. So just install macports from this page: That way you don't have opencv in the enthought distro, but you can simply install all the packages you use in the enthought distro using macports. I finally simply did it by installing python and opencv using macports. Coincidently I struggled yesterday with installing OpenCV on my mac as well. Īlthough I don't have an exact answer to your question, I do suppose I have a solution to your problem. # also the python packages should be searched in the correct locationĮxport PYTHONPATH=$EPDPATH/lib/python2.7/site-packagesĬmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX:PATH=$HOME/.local -D PYTHON_EXECUTABLE:FILEPATH=$EPDPATH/bin/python -D PYTHON_INCLUDE_DIR:PATH=$EPDPATH/include/python2.7 -D PYTHON_LIBRARY:FILEPATH=$EPDPATH/lib/libpython2.7.so -D PYTHON_LIBRARY_PATH:UNINITIALIZED=$EPDPATH/lib/libpython2.7.so -D PYTHON_NUMPY_INCLUDE_DIR:PATH=$EPDPATH/lib/python2.7/site-packages/numpy/core/include -D PYTHON_PACKAGES_PATH:PATH=$EPDPATH/lib/python2.7/site-packages -D SPHINX_BUILD:FILEPATH=$EPDPATH/bin/sphinx-build -D PYTHONINTERP_FOUND=1 -D BUILD_PYTHON_SUPPORT=ON -D INSTALL_PYTHON_EXAMPLES:BOOL=ON. # prepend the EPD bin dir to your path to make your shell prefer the EPD python interpreter to the system python interpreter Hint: I've been following the guidelines found on this website, but it's for Linux and it fails 95% into the "make" command: export EPDPATH=$HOME/.local/epd-7.3-2-rh5-x86_64 Any help would be greatly appreciated, the scripting isn't beyond me, but I don't have enough understanding of computer programming to figure out what these parameters mean and what needs to be different from Linux vs mac. All I care about in the end is somehow installing openCV into the Enthought python distribution on a Mac computer. Edit: Okay, I've generalized the question more in hopes that I get an answer.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |