命令错误,退出状态为一

时间:2019-08-27 15:27:31

标签: python testing

我正在我的PC(Windows 7)中安装qark以进行测试。我已经安装了python 3.7.2和pip 19.2.3。下一步,我必须在安装时安装require.txt文件,发生一个错误(命令错误,退出状态为1 :),我将在下面给出完整错误。

我尝试再次安装它,但是错误是相同的,我不知道该怎么办。帮我。 谢谢

    ERROR: Command errored out with exit status 1:
     command: 'c:\users\hp\appdata\local\programs\python\python37\python.exe' -c
 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\HP\\AppData\\L
ocal\\Temp\\pip-install-6tjj0pbq\\cffi\\setup.py'"'"'; __file__='"'"'C:\\Users\\
HP\\AppData\\Local\\Temp\\pip-install-6tjj0pbq\\cffi\\setup.py'"'"';f=getattr(to
kenize, '"'"'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\HP\AppData\Local\Temp\pip-install-6tjj0pbq\cffi\
    Complete output (27 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\HP\AppData\Local\Temp\pip-install-6tjj0pbq\cffi\setup.py",
line 120, in <module>
        if sys.platform == 'win32' and uses_msvc():
      File "C:\Users\HP\AppData\Local\Temp\pip-install-6tjj0pbq\cffi\setup.py",
line 98, in uses_msvc
        return config.try_compile('#ifndef _MSC_VER\n#error "not MSVC"\n#endif')

      File "c:\users\hp\appdata\local\programs\python\python37\lib\distutils\com
mand\config.py", line 227, in try_compile
        self._compile(body, headers, include_dirs, lang)
      File "c:\users\hp\appdata\local\programs\python\python37\lib\distutils\com
mand\config.py", line 133, in _compile
        self.compiler.compile([src], include_dirs=include_dirs)
      File "c:\users\hp\appdata\local\programs\python\python37\lib\distutils\_ms
vccompiler.py", line 345, in compile
        self.initialize()
      File "c:\users\hp\appdata\local\programs\python\python37\lib\distutils\_ms
vccompiler.py", line 238, in initialize
        vc_env = _get_vc_env(plat_spec)
      File "c:\users\hp\appdata\local\programs\python\python37\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\hp\appdata\local\programs\python\python37\lib\site-packages
\setuptools\msvc.py", line 1228, in return_env
        self.OSIncludes,
      File "c:\users\hp\appdata\local\programs\python\python37\lib\site-packages
\setuptools\msvc.py", line 963, in OSIncludes
        sdkver = self._sdk_subdir
      File "c:\users\hp\appdata\local\programs\python\python37\lib\site-packages
\setuptools\msvc.py", line 1057, in _sdk_subdir
        ucrtver = self.si.WindowsSdkLastVersion
      File "c:\users\hp\appdata\local\programs\python\python37\lib\site-packages
\setuptools\msvc.py", line 604, in WindowsSdkLastVersion
        self.WindowsSdkDir, 'lib'))
      File "c:\users\hp\appdata\local\programs\python\python37\lib\site-packages
\setuptools\msvc.py", line 809, in _use_last_dir_name
        for dir_name in reversed(os.listdir(path))
    FileNotFoundError: [WinError 3] The system cannot find the path specified: '
C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\PlatformSDK\\lib'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check th
e logs for full command output.

1 个答案:

答案 0 :(得分:0)

我也遇到类似的问题,其中cmd / PowerShell告诉我我缺少Windows Visual C ++版本,因此我遵循THIS网站上的内容,因此没有出现此问题。不再(出于安全考虑,我也重新启动了):

  
      
  1. 使用以下任一选项进行安装:      
  2.   
  3. 选择:工作负载→C ++构建工具。
  4.   
  5. 安装选项:仅选择“ Windows 10 SDK”(假设计算机是Windows 10)。 (可选)如果要从命令行使用MSVC cl.exe C / C ++编译器,请另外选择C ++构建工具,该工具会占用额外的2 GB磁盘空间。
  6.   


此外,为避免出现问题,我更喜欢安装Python 2.7.13 3.6 因为它们是经过测试的(如github page的要求所示)。

之后(再次按照说明),我使用以下命令安装了QARK:

pip install -r requirements.txt
pip install . --user


最后,要使其工作,我必须在环境变量的路径中添加以下定义: C:\ Users \ user \ AppData \ Roaming \ Python \ Scripts if(如果使用的是Python 2.x.x) C:\ Users \ utente \ AppData \ Roaming \ Python \ Python36 \ Scripts(如果您使用的是Python 3.x.x)

那之后,我运行它没有任何问题。
希望对您有所帮助! ?