我在安装 jwcrypto 和 cryptography 时遇到问题。我尝试安装多次,但始终出现相同的问题:
Microsoft Windows [Version 10.0.18362.295]
(c) 2019 Microsoft Corporation. All rights reserved.
C:\Users\KIIT>pip install python_jwt
Collecting python_jwt
Using cached https://files.pythonhosted.org/packages/30/35/df19a7eba32898dc89a99d597c9595f2e78c896c6a5c32decf786b751af5/python_jwt-3.2.4-py2.py3-none-any.whl
Collecting jwcrypto>=0.6.0 (from python_jwt)
Using cached https://files.pythonhosted.org/packages/f0/0d/00173a6aee1025e529b21c365182c8d06e78b1beb98d5633f841da6f122e/jwcrypto-0.6.0-py2.py3-none-any.whl
Collecting cryptography>=1.5 (from jwcrypto>=0.6.0->python_jwt)
Using cached https://files.pythonhosted.org/packages/c2/95/f43d02315f4ec074219c6e3124a87eba1d2d12196c2767fadfdc07a83884/cryptography-2.7.tar.gz
Installing build dependencies ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\kiit\appdata\local\programs\python\python38\python.exe' 'c:\users\kiit\appdata\local\programs\python\python38\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\KIIT\AppData\Local\Temp\pip-build-env-79umwzhl\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.6.0' wheel 'cffi>=1.8,!=1.11.3; python_implementation != '"'"'PyPy'"'"''
cwd: None
Complete output (42 lines):
Collecting setuptools>=40.6.0
Using cached https://files.pythonhosted.org/packages/b2/86/095d2f7829badc207c893dd4ac767e871f6cd547145df797ea26baea4e2e/setuptools-41.2.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.11.3,>=1.8
Using cached https://files.pythonhosted.org/packages/93/1a/ab8c62b5838722f29f3daffcc8d4bd61844aa9b5f437341cc890ceee483b/cffi-1.12.3.tar.gz
ERROR: Command errored out with exit status 1:
command: 'c:\users\kiit\appdata\local\programs\python\python38\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\KIIT\\AppData\\Local\\Temp\\pip-install-2fjh5djg\\cffi\\setup.py'"'"'; __file__='"'"'C:\\Users\\KIIT\\AppData\\Local\\Temp\\pip-install-2fjh5djg\\cffi\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
cwd: C:\Users\KIIT\AppData\Local\Temp\pip-install-2fjh5djg\cffi\
Complete output (30 lines):
Traceback (most recent call last):
File "c:\users\kiit\appdata\local\programs\python\python38\lib\site-packages\setuptools\msvc.py", line 489, in _find_latest_available_vc_ver
return self.find_available_vc_vers()[-1]
IndexError: list index out of range
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\KIIT\AppData\Local\Temp\pip-install-2fjh5djg\cffi\setup.py", line 127, in <module>
if sys.platform == 'win32' and uses_msvc():
File "C:\Users\KIIT\AppData\Local\Temp\pip-install-2fjh5djg\cffi\setup.py", line 105, in uses_msvc
return config.try_compile('#ifndef _MSC_VER\n#error "not MSVC"\n#endif')
File "c:\users\kiit\appdata\local\programs\python\python38\lib\distutils\command\config.py", line 225, in try_compile
self._compile(body, headers, include_dirs, lang)
File "c:\users\kiit\appdata\local\programs\python\python38\lib\distutils\command\config.py", line 132, in _compile
self.compiler.compile([src], include_dirs=include_dirs)
File "c:\users\kiit\appdata\local\programs\python\python38\lib\distutils\_msvccompiler.py", line 346, in compile
self.initialize()
File "c:\users\kiit\appdata\local\programs\python\python38\lib\distutils\_msvccompiler.py", line 239, in initialize
vc_env = _get_vc_env(plat_spec)
File "c:\users\kiit\appdata\local\programs\python\python38\lib\site-packages\setuptools\msvc.py", line 185, in msvc14_get_vc_env
return EnvironmentInfo(plat_spec, vc_min_ver=14.0).return_env()
File "c:\users\kiit\appdata\local\programs\python\python38\lib\site-packages\setuptools\msvc.py", line 843, in __init__
self.si = SystemInfo(self.ri, vc_ver)
File "c:\users\kiit\appdata\local\programs\python\python38\lib\site-packages\setuptools\msvc.py", line 485, in __init__
self.vc_ver = vc_ver or self._find_latest_available_vc_ver()
File "c:\users\kiit\appdata\local\programs\python\python38\lib\site-packages\setuptools\msvc.py", line 492, in _find_latest_available_vc_ver
raise distutils.errors.DistutilsPlatformError(err)
distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\kiit\appdata\local\programs\python\python38\python.exe' 'c:\users\kiit\appdata\local\programs\python\python38\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\KIIT\AppData\Local\Temp\pip-build-env-79umwzhl\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.6.0' wheel 'cffi>=1.8,!=1.11.3; python_implementation != '"'"'PyPy'"'"'' Check the logs for full command output.