pythonpython-2.7visual-studio-2013rauth

rauth ImportError: No module named structures


I try to use rauth in Visual Studio 2013 with Python 2.7 but it fails at the first line:

from rauth import OAuth1Session

because of a missing structures:

    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

I have installed all required modules except pycrypto which refuses to install:

warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath. error: Unable to find vcvarsall.bat

Any idea how to resolve this?


Solution

  • As noted above:

    pycrypto under Windows cannot be installed like any other Python module but rather with a Windows installer package like those listed here:

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