【发布时间】:2016-02-15 01:37:08
【问题描述】:
我正在尝试使用 this 教程在我的 Mac (OS X 10.11.3) 上安装 OpenCV,因为它使用 VirtualEnv,这是一种确保开发一致性的方法。
我跳过了第 1 步和第 2 步,因为我已经有了 Xcode 和 Homebrew。第 3 步运行良好(按照说明更新 ~/.bash_profile 后):
User:~ user$ brew update
Already up-to-date.
User:~ user$ source ~/.bash_profile
User:~ user$ which python
/usr/local/bin/python
User:~ user$
问题出在第 4 步:
User:~ user$ pip install virtualenv virtualenvwrapper
-bash: /usr/local/bin/pip: /usr/local/opt/python/bin/python2.7: bad interpreter: No such file or directory
User:~ user$
这可能是因为我在本地垃圾箱中,因为在第 3 步中将此添加到 ~/.bash_profile:
# Homebrew
export PATH=/usr/local/bin:$PATH
这基本上意味着我无法从该位置访问 pip,但是当我尝试在本地安装它时(在~/.bash_profile 中添加了上述行),它说:
User:~ user$ brew install pip
Error: No available formula with the name "pip"
Homebrew provides pip via: `brew install python`. However you will then
have two Pythons installed on your Mac, so alternatively you can install
pip via the instructions at:
https://pip.readthedocs.org/en/stable/installing/#install-pip
User:~ user$
如何使用第 3 步中更新的~/.bash_profile 访问 pip?谢谢!
【问题讨论】:
标签: macos opencv pip homebrew .bash-profile