/usr/bin/python3: Error while finding spec for ‘virtualenvwrapper.hook_loader‘ 解决

  • Post author:
  • Post category:python


centos 8 安装Python虚拟环境 后,打开出现如下提示

/usr/bin/python3: Error while finding module specification for ‘virtualenvwrapper.hook_loader’ (ModuleNotFoundError: 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/python3 and that PATH is

set properly.

搜索后,有的说修改.bashrc中的VIRTUALENVWRAPPER_PYTHON,之后执行source  ~/.bashrc。因环境安装的路径等没有问题,这个可以排除。

使用下面的命令

  1. pip install virtualenv virtualenvwrapper

  2. source ~/.bashrc

解决。