rauth ImportError:没有名为结构的模块

时间:2014-06-19 14:26:22

标签: python python-2.7 visual-studio-2013 rauth

我尝试在Python 2.7中使用Visual Studio 2013中的rauth,但它在第一行失败:

from rauth import OAuth1Session

因为缺少结构:

    Traceback (most recent call last):

File "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7  \IDE\Extensions\Microsoft\Python Tools for Visual Studio\2.0\
visualstudio_py_util.py", line 76, in exec_file
  exec(code_obj, global_variables)
File "c:\users\gustav.cactus\documents\visual studio 2013\Projects\PythonApplicationRauth1\PythonApplicationRauth1\
PythonApplicationRauth1.py", line 2, in <module>
  from rauth import OAuth1Session
File "C:\Python27\lib\site-packages\rauth\__init__.py", line 22, in <module>
  from .service import OAuth1Service, OAuth2Service, OflyService
File "C:\Python27\lib\site-packages\rauth\service.py", line 10, in <module>
  from rauth.session import OAuth1Session, OAuth2Session, OflySession
File "C:\Python27\lib\site-packages\rauth\session.py", line 16, in <module>
  from rauth.oauth import HmacSha1Signature
File "C:\Python27\lib\site-packages\rauth\oauth.py", line 15, in <module>
  from rauth.utils import FORM_URLENCODED
File "C:\Python27\lib\site-packages\rauth\utils.py", line 11, in <module>
  from requests.structures import CaseInsensitiveDict as cidict
ImportError: No module named structures

我已经安装了所有必需的模块,除了pycrypto拒绝安装:

警告:未找到GMP或MPIR库;没有构建Crypto.PublicKey._fastmath。 错误:无法找到vcvarsall.bat

知道如何解决这个问题吗?

1 个答案:

答案 0 :(得分:1)

如上所述:

Windows下的pycrypto不能像任何其他Python模块那样安装,而是安装Windows安装程序包,如下所示:

http://www.voidspace.org.uk/python/modules.shtml#pycrypto