繁体   English   中英

安装后仍无法导入gspread模块

[英]unable to import gspread module despite being installed

尽管我已经通过pip安装了gspread,但是无法在结构脚本上运行gspread。 我错过了什么?

Gangzhengs-MacBook-Pro:Fabric mosesliao$ pip install gspread
Collecting gspread
Requirement already satisfied (use --upgrade to upgrade): requests>=2.2.1 in /usr/local/lib/python2.7/site-packages (from gspread)
Installing collected packages: gspread
Successfully installed gspread-0.3.0
Gangzhengs-MacBook-Pro:Fabric mosesliao$ fab google_docs
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/fabric/main.py", line 658, in main
    docstring, callables, default = load_fabfile(fabfile)
  File "/Library/Python/2.7/site-packages/fabric/main.py", line 165, in load_fabfile
    imported = importer(os.path.splitext(fabfile)[0])
  File "/Users/mosesliao/svn/chubi-trunk-project/Fabric/fabfile.py", line 29, in <module>
    import gspread
ImportError: No module named gspread
Gangzhengs-MacBook-Pro:Fabric mosesliao$ pip install gspread
Requirement already satisfied (use --upgrade to upgrade): gspread in /usr/local/lib/python2.7/site-packages
Requirement already satisfied (use --upgrade to upgrade): requests>=2.2.1 in /usr/local/lib/python2.7/site-packages (from gspread)
Gangzhengs-MacBook-Pro:Fabric mosesliao$ python -V
Python 2.7.11
File "/Library/Python/2.7/site-packages/fabric/main.py", line 165, in load_fabfile

Requirement already satisfied (use --upgrade to upgrade): gspread in /usr/local/lib/python2.7/site-packages

似乎表明您的计算机上有两个python2.7安装。 一个是“类Mac”,另一个是“类Linux”。 也许您使用的是Mac默认安装的python ,而另一个则使用的是pip 至少值得一试...

which pip
which python

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM