安裝robotframewrok 的ssh庫 pip install robotframework-sshlibrary 遇到 error: Unable to find vcvarsall.bat

 error: Unable to find vcvarsall.bat

依照

https://github.com/robotframework/SSHLibrary


1. 先安裝 pip

download pip-6.0.8.zip from https://github.com/pypa/pip/releases  to a dir for example(C:\Python27\download)
unzip it and cd the dir(C:\Python27\download\pip-6.0.8)
python setup.py install
C:\>cdC:\Python27\download\pip-6.0.8
C:\Python27\download\pip-6.0.8> python setup.py install

2. 
cd c:\Python27\Scripts    (python本機的安裝路徑c:\Python27)

c:\Python27\Scripts>pip install robotframework-sshlibrary


    error: Unable to find vcvarsall.bat

    ----------------------------------------
    Command "C:\Python27\python.exe -c "import setuptools, tokenize;__file__='c
:\\users\\clchen\\appdata\\local\\temp\\pip-build-vc3qmm\\pycrypto\\setup.py';ex
ec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'
), __file__, 'exec'))" install --record c:\users\clchen\appdata\local\temp\pip-p
rkrxq-record\install-record.txt --single-version-externally-managed --compile" f
ailed with error code 1 in c:\users\clchen\appdata\local\temp\pip-build-vc3qmm\p
ycrypto

3. 認真看下,Notice that on Windows you should still install PyCrypto manually first.  on 

https://github.com/robotframework/SSHLibrary

於是到https://github.com/robotframework/SSHLibrary/blob/master/INSTALL.rst裏面,找到了

PyCrypto安裝包的下載地址:

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

The PyCrypto 2.6 files are all bdist_wininst created with MS Visual Studio 2008 and 2010 (for 3.3). The binaries don't include MPIR / GMP _fastmath.

選擇自己對應的python版本,32位or 64位的cpu, 我的對應的是

下載下來,先安裝這個exe


然後:重新執行

cd c:\Python27\Scripts    (python本機的安裝路徑c:\Python27)

c:\Python27\Scripts>pip install robotframework-sshlibrary


sshlibrary 安裝成功了


c:\Python27\Scripts>pip install robotframework-sshlibrary
Collecting robotframework-sshlibrary
  Using cached robotframework-sshlibrary-2.1.1.tar.gz
Requirement already satisfied (use --upgrade to upgrade): robotframework in d:\python278\lib\site-pa
ckages (from robotframework-sshlibrary)
Collecting paramiko>=1.8.0 (from robotframework-sshlibrary)
  Using cached paramiko-1.15.2-py2.py3-none-any.whl
Collecting ecdsa>=0.11 (from paramiko>=1.8.0->robotframework-sshlibrary)
  Using cached ecdsa-0.13-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): pycrypto!=2.4,>=2.1 in d:\python278\lib\si
te-packages (from paramiko>=1.8.0->robotframework-sshlibrary)
Installing collected packages: ecdsa, paramiko, robotframework-sshlibrary

  Running setup.py install for robotframework-sshlibrary
Successfully installed ecdsa-0.13 paramiko-1.15.2 robotframework-sshlibrary-2.1.1


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章