Python: ImportError: No module named xxx even after performing pip ins Python:ImportError:无法找到模块xxx,即使执行pip ins后也是如此

2024-05-16 15:42:19 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在安装项目https://github.com/wavefrontHQ/python-client并对其进行测试:

edamame$ pip install wavefront_client
Requirement already satisfied: wavefront_client in /usr/local/lib/python2.7/site-packages
Requirement already satisfied: urllib3>=1.15 in /usr/local/lib/python2.7/site-packages (from wavefront_client)
Requirement already satisfied: six>=1.10 in /usr/local/lib/python2.7/site-packages (from wavefront_client)
Requirement already satisfied: certifi in /usr/local/lib/python2.7/site-packages (from wavefront_client)
Requirement already satisfied: python-dateutil in /usr/local/lib/python2.7/site-packages (from wavefront_client)

这是我的test.py

^{pr2}$

但我得到了一个错误:

edameme$ python test.py
    Traceback (most recent call last):
      File "test.py", line 1, in <module>
        import wavefront_api_client
    ImportError: No module named wavefront_api_client

如果我这么做系统打印在文件的开头,我得到:

我得到:['/Users/edamame/Documents/git/python_wave', '/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/Library/Python/2.7/site-packages', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC']

为什么即使我已经安装了wavefront_api_客户端,也会出现这个错误?谢谢!在


Tags: inclientlibpackagesusrlibrarysiteframework