At the time of writing I am working on a tool that utilities rdpy. I encountered some problems installing it so I thought I’d document how I solved them for when I inevitably need to rebuild my laptop and in the hope that it will be useful to others.
Following the instructions in the readme: https://github.com/citronneur/rdpy/blob/master/README.md
pip install rdpy
Failed with error:
error: Unable to find vcvarsall.bat
This cryptic error message means that the compiler required to compile the C/C++ code in the package is not present on the system. Usually in this situation the easiest option is to download a precompiled version of the package. Unfortunately I haven’t been able to find a precompiled version of rdpy, so a compiler is required, preferably the same one used to compile the version of Python you are using. For 2.7 this is Visual Studio C++ 2008 and for 3.4.1 this is Visual Studio C++ 2010.
You can double check which version you need using the Python interactive interpreter. If the version information (shown bold red below) shows MSC v.1500 you need Visual Studio C++ 2008, whereas if it show MSC v.1600 you need Visual Studio C++ 2010.
c:\>python ActivePython 126.96.36.199 (ActiveState Software Inc.) based on Python 2.7.8 (default, Jul 2 2014, 19:48:49) [MSC v.1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> exit()
So where do you get Visual Studio C++ 2008 from? Well you only need the express edition, so you can get for free from here (at the time of writing).
You will also need to install the Windows SDK, again the version is important Windows SDK for Windows 7 and .NET Framework 3.5 SP1, you should be able to uncheck everything except:
Developer Tools >> Visual C++ Compilers
(Note I encountered installation errors when I attempted this, this is probably unique to my machine, but if you also encounter a problem try installing the complete SDK, which worked for me.)
(You should register Visual Studio (for free) within 30 days.)
At this point you should now be able to install the package, however you may get this error (discussed here ):
This is because the latest version of Visual Studio has changed the .bat file, but Python has not yet (at the time of writing) updated to account for this.
To fix this error you simply need to copy the <install_location>\VC\bin\vcvars64.bat to <install_location>\VC\bin\vcvarsamd64.bat and <install_location>\VC\bin\amd64\vcvarsamd64.bat
Assuming the default install path is used (C:\Program Files (x86)\Microsoft Visual Studio 9.0) the following will accomplish this if run in an elevated command prompt (i.e. Run as Administrator):
copy "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars64.bat" "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvarsamd64.bat"
copy "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars64.bat" "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\amd64\vcvarsamd64.bat"
With Visual Studio installed, rdpy should now install correctly.
There are two dependencies for rdpy, PyWin32 and PyQt4. The easiest way I have found to install PyWin32 is to install ActivePython which comes with this package. An installer for PyQt4 is available here (ensure you select the correct installer for your version of Python and operating system architecture).
With the dependencies met you should now be able to use rdpy. However you are likely to encounter this error:
C:\Python27\lib\site-packages\twisted\internet\_sslverify.py:184: UserWarning: You do not have the service_identity module installed. Please install it from <https://pypi.python.org/pypi/service_identity>. Without the service_identity module and a recent enough pyOpenSSL to support it, Twisted can perform only rudimentary TLS client hostnameverification. Many valid certificate/hostname mappings may be rejected. verifyHostname, VerificationError = _selectVerifyImplementation()
As this helpful error message indicates, you need to install the service_identity module. This can be done easily using pip:
pip install service_identity
As always, if you have any comments or suggestions please feel free to get in touch.