【问题标题】:paramiko installation for python failed : 'unable to find vcvarsall.bat'python 的 paramiko 安装失败:'无法找到 vcvarsall.bat'
【发布时间】:2021-02-17 07:07:02
【问题描述】:

我正在尝试使用 pip 安装 paramiko 包,但由于此错误而无法继续。

操作系统:Win 10 x64

Python 版本:3.4.0 x86

我也安装了MS Visual C++ 2008 Express版,发现环境变量设置正确。

但是,它仍然说找不到 vcvarsall.bat。命令行附在下面。 PL。提出解决方案。

C:\>pip install paramiko
Collecting paramiko
  Using cached https://files.pythonhosted.org/packages/95/19/124e9287b43e6ff3ebb9cdea3e5e8e88475a873c05ccdf8b7e20d2c4201e/paramiko-2.7.2-py2.py3-none-any.whl
Collecting bcrypt>=3.1.3 (from paramiko)
  Using cached https://files.pythonhosted.org/packages/04/1c/a026eef0c7547b9eef7c61d25df0c21ddacf91592725d6279ab2a500a39d/bcrypt-3.1.7-cp34-cp34m-win32.whl
Collecting pynacl>=1.0.1 (from paramiko)
  Using cached https://files.pythonhosted.org/packages/cf/5a/25aeb636baeceab15c8e57e66b8aa930c011ec1c035f284170cacb05025e/PyNaCl-1.4.0.tar.gz
  Installing build dependencies ... error
  Complete output from command C:\Python34\python.exe -m pip install --ignore-installed --no-user --prefix C:\Users\Raghavan\AppData\Local\Temp\pip-build-env-nnl_k10v --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools>=40.8.0 wheel "cffi>=1.4.1; python_implementation != 'PyPy'":
  Collecting setuptools>=40.8.0
    Using cached https://files.pythonhosted.org/packages/91/af/18d58ed8a8e7e6b91d71b0367034faf8ea41e1004018811388ed07a7f2d6/setuptools-43.0.0-py2.py3-none-any.whl
  Collecting wheel
    Using cached https://files.pythonhosted.org/packages/00/83/b4a77d044e78ad1a45610eb88f745be2fd2c6d658f9798a15e384b7d57c9/wheel-0.33.6-py2.py3-none-any.whl
  Collecting cffi>=1.4.1
    Using cached https://files.pythonhosted.org/packages/cb/ae/380e33d621ae301770358eb11a896a34c34f30db188847a561e8e39ee866/cffi-1.14.3.tar.gz
      Complete output from command python setup.py egg_info:
      Traceback (most recent call last):
        File "<string>", line 1, in <module>
        File "C:\Users\Raghavan\AppData\Local\Temp\pip-install-3wu31oij\cffi\setup.py", line 131, in <module>
          if sys.platform == 'win32' and uses_msvc():
        File "C:\Users\Raghavan\AppData\Local\Temp\pip-install-3wu31oij\cffi\setup.py", line 109, in uses_msvc
          return config.try_compile('#ifndef _MSC_VER\n#error "not MSVC"\n#endif')
        File "C:\Python34\lib\distutils\command\config.py", line 227, in try_compile
          self._compile(body, headers, include_dirs, lang)
        File "C:\Python34\lib\distutils\command\config.py", line 133, in _compile
          self.compiler.compile([src], include_dirs=include_dirs)
        File "C:\Python34\lib\distutils\msvc9compiler.py", line 460, in compile
          self.initialize()
        File "C:\Python34\lib\distutils\msvc9compiler.py", line 371, in initialize
          vc_env = query_vcvarsall(VERSION, plat_spec)
        File "C:\Python34\lib\distutils\msvc9compiler.py", line 259, in query_vcvarsall
          raise DistutilsPlatformError("Unable to find vcvarsall.bat")
      distutils.errors.DistutilsPlatformError: Unable to find vcvarsall.bat

      ----------------------------------------
  Command "python setup.py egg_info" failed with error code 1 in C:\Users\Raghavan\AppData\Local\Temp\pip-install-3wu31oij\cffi\

  ----------------------------------------
Command "C:\Python34\python.exe -m pip install --ignore-installed --no-user --prefix C:\Users\Raghavan\AppData\Local\Temp\pip-build-env-nnl_k10v --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools>=40.8.0 wheel "cffi>=1.4.1; python_implementation != 'PyPy'"" failed with error code 1 in None

【问题讨论】:

    标签: python python-3.x pip windows-10 paramiko


    【解决方案1】:

    我在为 Pycharm 安装 paramiko 时遇到了问题。 我发现的一个建议是使用预装了许多软件包(包括 paramiko)的 anaconda。

    找到解决办法:
    python -m pip install --upgrade pip
    此命令将我的 pip 版本从 19.2.3 更新到 20.3.3

    然后成功安装paramiko:
    python -m pip install -U paramiko

    Python 3.8 已安装在我的系统中。

    【讨论】:

      猜你喜欢
      • 2016-04-04
      • 1970-01-01
      • 2013-09-30
      • 1970-01-01
      • 1970-01-01
      • 2015-12-14
      • 2013-10-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多