OpenCV树莓派4b 错误 Error: Environment /Users/myuser/.virtualenvs/iron does not contain activation script

在树莓派4b上安装和配置OpenCV的过程中碰到的错误。
根据教程安装 virtualenv 和 virtualenvwrapper:

$ sudo pip install virtualenv virtualenvwrapper

安装完之后,打开 ~/.bashrc 文件:

$ nano ~/.bashrc

并把以下内容添加到文件最后:

# virtualenv and virtualenvwrapper
export WORKON_HOME=$HOME/.virtualenvs
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
source /usr/local/bin/virtualenvwrapper.sh

保存之后退出,然后重新加载 ~/.bashrc

$ source ~/.bashrc

报错:

Error: Environment /Users/myuser/.virtualenvs/iron does not contain activation script

解决方法:

在文件最后添加:

export WORKON_HOME=$HOME/.virtualenvs
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
export VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv
source /usr/local/bin/virtualenvwrapper.sh
export VIRTUALENVWRAPPER_ENV_BIN_DIR=bin  # <== This line fixed it for me

保存之后退出,然后重新加载 ~/.bashrc

$ source ~/.bashrc

参考链接

你可能感兴趣的:(opencv,python,raspberry,pi)