在Mac OS X上配置OpenCV Python版本
来源:互联网 发布:java工程师工资待遇 编辑:程序博客网 时间:2024/05/19 00:16
转载自我的个人网站上的博客。
I didn't expect to spent 2 days to set up opencv python environment on my mbp!! Here is my advice on how to intall opencv with python support on mac os x.
0.Make sure you have homebrew installed, which is really convinient to manage software packages on mac and is easy to use.
1.First, I suggest you to uninstall all python versions that are not provided with original system.[1]
sudo rm -rf /Library/Frameworks/Python.framework/Versions/2.7
sudo rm -rf "/Applications/Python 2.7" (the Applications file is located in the root of your system, not under your username directory)
brew uninstall python (if you have installed python with homebrew before)
2.Reinstall python by homebrew.[2]
brew tap homebrew/science
brew install python
Then set your PYTHONPATH.[3]
PYTHONPATH="${PYTHONPATH}:/usr/local/lib/python2.7/site-packages/"
export PYTHONPATH
3.Install OpenCV
brew install opencv
4.Check it!
python
import cv2
If there's no problem, than congratulations!
5.Trouble Shooting
1.I met a confusing problem when linking opencv using homebrew. The error message was like "/some/path isn't writable". I fixed this problem by
sudo chown username /some/path
where chown means change ownership
2.You can use
brew doctor
to see if there's any problem with your homebrew management, and most wonderful thing is the doctor do provide some very useful tips!
Hope this article helped you. Have fun!
Thanks to these articles:
[1]http://stackoverflow.com/questions/3819449/how-to-uninstall-python-2-7-on-a-mac-os-x-10-6-4
[2]https://jjyap.wordpress.com/2014/05/24/installing-opencv-2-4-9-on-mac-osx-with-python-support/
[3]https://scipher.wordpress.com/2010/05/10/setting-your-pythonpath-environment-variable-linuxunixosx/
- 在Mac OS X上配置OpenCV Python版本
- Mac OS X 上配置 Python
- 在Mac OS X上安装Python
- Mac OS X 上如何切换默认的 Python 版本?
- 在Mac OS X 上配置$JAVA_HOME环境变量
- 在mac OS X中配置python mysql开发环境
- 【Mac】在Mac OS X下解决opencv与Python的No module named cv2问题
- 在mac os x 上安装apache2
- 在Mac OS X上安装Git
- 在Mac OS X上安装PostgreSQL
- 在Mac OS X上安装TensorFlow
- 在 Mac OS X 上安装 TensorFlow
- 在 Mac OS X 上安装 TensorFlow
- Mac OS X安装opencv并配置到Xcode和eclipse上
- Mac OS X安装opencv并配置到Xcode和eclipse上
- 在mac上配置opencv python开发环境
- 在苹果MAC OS X系统上使用Outlook for MAC 2011配置Exchange邮箱
- 在Mac OS X中配置Apache
- tomcat7下JDNI连接池的配置
- Bash的基本功能
- SSH配置文件之applicationContext.xml
- 人脸识别必读的N篇文章
- JavaBean入门 - 概念和简单例子
- 在Mac OS X上配置OpenCV Python版本
- UDP通讯中数据不能写入文件的问题
- libev 代码阅读
- django交互模式使用模板报:django.core.exceptions.ImproperlyConfigured
- UVa 10706 - Number Sequence
- UEditor文件上传辅助类
- BI商业智能培训系列——(二)SSIS入门
- UVA - 10420 - List of Conquests (排序 - qsort、STL)
- 中国天气网api(json格式)