在Raspberry Pi 3上设置virtualenv和virtualenvwrapper的问题

时间:2017-10-08 17:09:20

标签: python opencv raspberry-pi virtual environment

我正在按照一个看起来非常全面的教程:

https://www.pyimagesearch.com/2016/04/18/install-guide-raspberry-pi-3-raspbian-jessie-opencv-3/

但在尝试在这些更改后加载〜/ .profile时收到错误:

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

运行后的整个输出

source ~/.profile

是:

pi@SamPi:~ $ source ~/.profile
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/local/lib/python2.7/dist-packages/virtualenvwrapper/hook_loader.py", line 223, in <module>
    main()
  File "/usr/local/lib/python2.7/dist-packages/virtualenvwrapper/hook_loader.py", line 132, in main
    run_hooks(hook, options, args)
  File "/usr/local/lib/python2.7/dist-packages/virtualenvwrapper/hook_loader.py", line 161, in run_hooks
    hook_mgr = ExtensionManager(namespace)
  File "/usr/local/lib/python2.7/dist-packages/stevedore/extension.py", line 106, in __init__
    verify_requirements)
  File "/usr/local/lib/python2.7/dist-packages/stevedore/extension.py", line 188, in _load_plugins
    for ep in self.list_entry_points():
  File "/usr/local/lib/python2.7/dist-packages/stevedore/extension.py", line 177, in list_entry_points
    eps = list(pkg_resources.iter_entry_points(self.namespace))
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 521, in iter_entry_points
    entries = dist.get_entry_map(group)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2484, in get_entry_map
    self._get_metadata('entry_points.txt'), self
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2261, in parse_map
    raise ValueError("Entry points must be listed in groups")
ValueError: Entry points must be listed in groups
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.

2 个答案:

答案 0 :(得分:2)

&#34;检查virtualenvwrapper是否已安装&#34;: 所以重新安装virtualenvwrapper。打开e新终端并从这一行开始:

$ sudo pip install virtualenv virtualenvwrapper

答案 1 :(得分:0)

我遇到了同样的问题,并且在python 2中安装了virtualenv和virtualenvwrapper。为我指定了pip3已解决的问题。

sudo pip3 install virtualenv virtualenvwrapper