“此错误源自子进程,可能不是 pip 的问题”

问题描述 投票:0回答:1

我尝试使用我的终端和 torch.version = 1.13.1+cu117 安装 apex。我按照命令和说明进行操作,但没有成功。我正在使用Python 3.11

git clone https://github.com/NVIDIA/apex
cd apex
pip install -r requirements.txt
pip install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" .

错误信息如下所示。很抱歉打扰您,但我非常感谢您的帮助。

(venv) C:\Users\iml\Desktop\DecoupleSegNets-master\apex>pip install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" .
Using pip 23.0.1 from C:\Users\iml\Desktop\SpatialEmbedding_RA\venv\lib\site-packages\pip (python 3.9)
WARNING: Implying --no-binary=:all: due to the presence of --build-option / --global-option / --install-option. Consider using --config-settings for more 
flexibility.
DEPRECATION: --no-binary currently disables reading from the cache of locally built wheels. In the future --no-binary will not influence the wheel cache. 
pip 23.1 will enforce this behaviour change. A possible replacement is to use the --no-cache-dir option. You can use the flag --use-feature=no-binary-enab
le-wheel-cache to test the upcoming behaviour. Discussion can be found at https://github.com/pypa/pip/issues/11453
Processing c:\users\iml\desktop\decouplesegnets-master\apex
  Running command python setup.py egg_info
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "C:\Users\iml\Desktop\DecoupleSegNets-master\apex\setup.py", line 130, in <module>
      _, bare_metal_version = get_cuda_bare_metal_version(CUDA_HOME)
    File "C:\Users\iml\Desktop\DecoupleSegNets-master\apex\setup.py", line 17, in get_cuda_bare_metal_version
      raw_output = subprocess.check_output([cuda_dir + "/bin/nvcc", "-V"], universal_newlines=True)
  TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'


  torch.__version__  = 1.13.1+cu117


  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: 'C:\Users\iml\Desktop\SpatialEmbedding_RA\venv\Scripts\python.exe' -c '
  exec(compile('"'"''"'"''"'"'
  # This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
  #
  # - It imports setuptools before invoking setup.py, to enable projects that directly
  #   import from `distutils.core` to work with newer packaging standards.
  # - It provides a clear error message when setuptools is not installed.
  # - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so
  #   setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning:
  #     manifest_maker: standard file '"'"'-c'"'"' not found".
  # - It generates a shim setup.py, for handling setup.cfg-only projects.
  import os, sys, tokenize
  
  try:
      import setuptools
  except ImportError as error:
      print(
          "ERROR: Can not execute `setup.py` since setuptools is not available in "
          "the build environment.",
          file=sys.stderr,
      )
      sys.exit(1)
  
  __file__ = %r
  sys.argv[0] = __file__
  
  if os.path.exists(__file__):
      filename = __file__
      with tokenize.open(__file__) as f:
          setup_py_code = f.read()
  else:
      filename = "<auto-generated setuptools caller>"
      setup_py_code = "from setuptools import setup; setup()"
  
  exec(compile(setup_py_code, filename, "exec"))
  '"'"''"'"''"'"' % ('"'"'C:\\Users\\iml\\Desktop\\DecoupleSegNets-master\\apex\\setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' egg_info --egg-base
 'C:\Users\iml\AppData\Local\Temp\pip-pip-egg-info-90lgnj0k'
  cwd: C:\Users\iml\Desktop\DecoupleSegNets-master\apex\
  Preparing metadata (setup.py) ... error
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

(venv) C:\Users\iml\Desktop\DecoupleSegNets-master\apex>pip install pip==21.3.1
Collecting pip==21.3.1
  Downloading pip-21.3.1-py3-none-any.whl (1.7 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.7/1.7 MB 10.9 MB/s eta 0:00:00
ERROR: To modify pip, please run the following command:
C:\Users\iml\Desktop\SpatialEmbedding_RA\venv\Scripts\python.exe -m pip install pip==21.3.1

(venv) C:\Users\iml\Desktop\DecoupleSegNets-master\apex>C:\Users\iml\Desktop\SpatialEmbedding_RA\venv\Scripts\python.exe -m pip install pip==21.3.1
Collecting pip==21.3.1
  Using cached pip-21.3.1-py3-none-any.whl (1.7 MB)
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 23.0.1
    Uninstalling pip-23.0.1:
      Successfully uninstalled pip-23.0.1
Successfully installed pip-21.3.1

(venv) C:\Users\iml\Desktop\DecoupleSegNets-master\apex>pip install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" .    
C:\Users\iml\Desktop\SpatialEmbedding_RA\venv\lib\site-packages\pip\_internal\commands\install.py:245: UserWarning: Disabling all use of wheels due to the
 use of --build-option / --global-option / --install-option.
  cmdoptions.check_install_build_global(options)
Using pip 21.3.1 from C:\Users\iml\Desktop\SpatialEmbedding_RA\venv\lib\site-packages\pip (python 3.9)
Processing c:\users\iml\desktop\decouplesegnets-master\apex
  Running command python setup.py egg_info
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "C:\Users\iml\Desktop\DecoupleSegNets-master\apex\setup.py", line 130, in <module>
      _, bare_metal_version = get_cuda_bare_metal_version(CUDA_HOME)
    File "C:\Users\iml\Desktop\DecoupleSegNets-master\apex\setup.py", line 17, in get_cuda_bare_metal_version
      raw_output = subprocess.check_output([cuda_dir + "/bin/nvcc", "-V"], universal_newlines=True)
  TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'


  torch.__version__  = 1.13.1+cu117


  Preparing metadata (setup.py) ... error
WARNING: Discarding file:///C:/Users/iml/Desktop/DecoupleSegNets-master/apex. Command errored out with exit status 1: python setup.py egg_info Check the l
ogs for full command output.
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
WARNING: You are using pip version 21.3.1; however, version 23.0.1 is available.
You should consider upgrading via the 'C:\Users\iml\Desktop\SpatialEmbedding_RA\venv\Scripts\python.exe -m pip install --upgrade pip' command.

(venv) C:\Users\iml\Desktop\DecoupleSegNets-master\apex>C:\Users\iml\Desktop\SpatialEmbedding_RA\venv\Scripts\python.exe -m pip install pip==21.3.1
Requirement already satisfied: pip==21.3.1 in c:\users\iml\desktop\spatialembedding_ra\venv\lib\site-packages (21.3.1)
WARNING: You are using pip version 21.3.1; however, version 23.0.1 is available.
You should consider upgrading via the 'C:\Users\iml\Desktop\SpatialEmbedding_RA\venv\Scripts\python.exe -m pip install --upgrade pip' command.

(venv) C:\Users\iml\Desktop\DecoupleSegNets-master\apex>C:\Users\iml\Desktop\SpatialEmbedding_RA\venv\Scripts\python.exe -m pip install pip==23.0.1 
Collecting pip==23.0.1
  Using cached pip-23.0.1-py3-none-any.whl (2.1 MB)
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 21.3.1
    Uninstalling pip-21.3.1:
      Successfully uninstalled pip-21.3.1
Successfully installed pip-23.0.1

(venv) C:\Users\iml\Desktop\DecoupleSegNets-master\apex>pip install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" .    
Using pip 23.0.1 from C:\Users\iml\Desktop\SpatialEmbedding_RA\venv\lib\site-packages\pip (python 3.9)
WARNING: Implying --no-binary=:all: due to the presence of --build-option / --global-option / --install-option. Consider using --config-settings for more 
flexibility.
DEPRECATION: --no-binary currently disables reading from the cache of locally built wheels. In the future --no-binary will not influence the wheel cache. 
pip 23.1 will enforce this behaviour change. A possible replacement is to use the --no-cache-dir option. You can use the flag --use-feature=no-binary-enab
le-wheel-cache to test the upcoming behaviour. Discussion can be found at https://github.com/pypa/pip/issues/11453
Processing c:\users\iml\desktop\decouplesegnets-master\apex
  Running command python setup.py egg_info
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "C:\Users\iml\Desktop\DecoupleSegNets-master\apex\setup.py", line 130, in <module>
      _, bare_metal_version = get_cuda_bare_metal_version(CUDA_HOME)
    File "C:\Users\iml\Desktop\DecoupleSegNets-master\apex\setup.py", line 17, in get_cuda_bare_metal_version
      raw_output = subprocess.check_output([cuda_dir + "/bin/nvcc", "-V"], universal_newlines=True)
  TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'


  torch.__version__  = 1.13.1+cu117


  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: 'C:\Users\iml\Desktop\SpatialEmbedding_RA\venv\Scripts\python.exe' -c '
  exec(compile('"'"''"'"''"'"'
  # This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
  #
  # - It imports setuptools before invoking setup.py, to enable projects that directly
  #   import from `distutils.core` to work with newer packaging standards.
  else:
      filename = "<auto-generated setuptools caller>"
      setup_py_code = "from setuptools import setup; setup()"

  exec(compile(setup_py_code, filename, "exec"))
  '"'"''"'"''"'"' % ('"'"'C:\\Users\\iml\\Desktop\\DecoupleSegNets-master\\apex\\setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' egg_info --egg-base
 'C:\Users\iml\AppData\Local\Temp\pip-pip-egg-info-ozhr7xok'
  cwd: C:\Users\iml\Desktop\DecoupleSegNets-master\apex\
  Preparing metadata (setup.py) ... error
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

以上是安装时的错误 谢谢你的努力。 祝你有美好的一天!

python debugging error-handling pip subprocess
1个回答
0
投票

编辑:它又起作用了!我基本上只是翻遍了我的目录,发现 Cuda 没有安装。然后我为我的 Nvidia 显卡下载了它,解决了我的问题!

© www.soinside.com 2019 - 2024. All rights reserved.