今天在编译一个文档的时候报错提示未安装 ImportError: No module named click
, 执行了 pip list
检查发现 click
是已经安装好的,请教如何解决这个问题
pip list|grep click
click (6.6)
我还安装了 virtualenv
不知道这个包会不会有什么影响
ringa_lee2017-04-17 17:48:41
It’s very simple. First check the python path you are currently executing, whether it is /usr/bin/python or something else. Then there will be a pip under the same path, such as /usr/bin/pip, and then execute /usr/bin/pip install click, this will be fine
怪我咯2017-04-17 17:48:41
First of all, you mentioned that you installed virtualenv, then you need to determine one thing, whether you installed click in the system environment or virtualenv environment.
Is the python running in the system environment or virtualenv environment?
If it is correct, then you need to determine the package version issue.
Hope it helps.
迷茫2017-04-17 17:48:41
The python interpreter you imported is not the same as the one you installed click
大家讲道理2017-04-17 17:48:41
First enter the virtual environment of virtualenv, and then execute your script, it will usually be there. Also, you can use sys to insert the directory of your virtual environment into it
import sys
sys.path.insert(0,‘您的虚拟环境的目录’)