正如我所说,我在Raspberry pi3上安装Open cv时遇到错误,我正在按照pyimagesearch的指示进行操作。我收到错误如下
pi@raspberrypi:~ $ sudo python get-pip.py
Collecting pip
Downloading pip-9.0.3-py2.py3-none-any.whl (1.4MB)
100% |████████████████████████████████| 1.4MB 72kB/s
Installing collected packages: pip
Found existing installation: pip 9.0.1
Uninstalling pip-9.0.1:
Successfully uninstalled pip-9.0.1
Successfully installed pip-9.0.3
pi@raspberrypi:~ $ sudo python3 get-pip.py
Collecting pip
Using cached pip-9.0.3-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 9.0.1
Uninstalling pip-9.0.1:
Successfully uninstalled pip-9.0.1
Successfully installed pip-9.0.3
pi@raspberrypi:~ $ sudo pip install virtualenv virtualenvwrapper
Collecting virtualenv
Downloading virtualenv-15.2.0-py2.py3-none-any.whl (2.6MB)
100% |████████████████████████████████| 2.6MB 47kB/s
Collecting virtualenvwrapper
Downloading virtualenvwrapper-4.8.2-py2.py3-none-any.whl
Collecting stevedore (from virtualenvwrapper)
Downloading stevedore-1.28.0-py2.py3-none-any.whl
Collecting virtualenv-clone (from virtualenvwrapper)
Downloading virtualenv_clone-0.3.0-py2.py3-none-any.whl
Collecting pbr!=2.1.0,>=2.0.0 (from stevedore->virtualenvwrapper)
Downloading pbr-4.0.2-py2.py3-none-any.whl (98kB)
100% |████████████████████████████████| 102kB 278kB/s
Requirement already satisfied: six>=1.10.0 in /usr/lib/python3/dist-packages (from stevedore->virtualenvwrapper)
Installing collected packages: virtualenv, pbr, stevedore, virtualenv-clone, virtualenvwrapper
Successfully installed pbr-4.0.2 stevedore-1.28.0 virtualenv-15.2.0 virtualenv-clone-0.3.0 virtualenvwrapper-4.8.2
pi@raspberrypi:~ $ sudo rm -rf ~/.cache/pip
pi@raspberrypi:~ $ export WORKON_HOME=$HOME/.virtualenvs
pi@raspberrypi:~ $ source /usr/local/bin/virtualenvwrapper.sh
/usr/bin/python: No module named virtualenvwrapper
virtualenvwrapper.sh: There was a problem running the initialization hooks.
If Python could not import the module virtualenvwrapper.hook_loader,
check that virtualenvwrapper has been installed for
VIRTUALENVWRAPPER_PYTHON=/usr/bin/python and that PATH is
set properly.
pi@raspberrypi:~ $ echo -e "\n# virtualenv and virtualenvwrapper" >> ~/.profile
pi@raspberrypi:~ $ echo "export WORKON_HOME=$HOME/.virtualenvs" >> ~/.profile
pi@raspberrypi:~ $ echo "source /usr/local/bin/virtualenvwrapper.sh" >> ~/.profile
pi@raspberrypi:~ $ source ~/.profile
/usr/bin/python: No module named virtualenvwrapper
virtualenvwrapper.sh: There was a problem running the initialization hooks.
If Python could not import the module virtualenvwrapper.hook_loader,
check that virtualenvwrapper has been installed for
VIRTUALENVWRAPPER_PYTHON=/usr/bin/python and that PATH is
set properly.
pi@raspberrypi:~ $ mkvirtualenv cv -p python2
Running virtualenv with interpreter /usr/bin/python2
New python executable in /home/pi/.virtualenvs/cv/bin/python2
Also creating executable in /home/pi/.virtualenvs/cv/bin/python
Installing setuptools, pip, wheel...done.
/usr/bin/python: No module named virtualenvwrapper
pi@raspberrypi:~ $ mkvirtualenv cv -p python3
Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /home/pi/.virtualenvs/cv/bin/python3
Not overwriting existing python script /home/pi/.virtualenvs/cv/bin/python (you must use /home/pi/.virtualenvs/cv/bin/python3)
Installing setuptools, pip, wheel...done.
/usr/bin/python: No module named virtualenvwrapper
pi@raspberrypi:~ $ source ~/.profile
/usr/bin/python: No module named virtualenvwrapper
virtualenvwrapper.sh: There was a problem running the initialization hooks.
If Python could not import the module virtualenvwrapper.hook_loader,
check that virtualenvwrapper has been installed for
VIRTUALENVWRAPPER_PYTHON=/usr/bin/python and that PATH is
set properly.
I get error as virtualenvwrapper.sh: There was a problem running the initialization hooks. How can I fix this error? I can't figure out why am I getting this error. I searched google It didn't fix my issue.I keep getting bash: /usr/local/bin/python3: No such file or directory
virtualenvwrapper.sh:运行初始化挂钩时出现问题。
如果Python无法导入模块virtualenvwrapper.hook_loader, 检查是否已安装virtualenvwrapper VIRTUALENVWRAPPER_PYTHON = / usr / local / bin / python3,PATH是 设置得当。 我怎样才能解决这个问题 ?我试图卸载并重新安装virtualenv它没有锻炼。我需要重新安装软件并从头开始吗?这花了很多时间,特别是在raspberrypi我不想这样做,帮我解决这个问题