python - 命令出错,退出状态为 1 : python setup. py egg_info 检查日志以获取完整的命令输出

标签 python python-3.x pip package

我尝试在 mac 终端中运行 pip install spatial-correlation-sampler 但出现错误 -

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:
     command: /anaconda3/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/cw/7_q449q1001fzq0ttwsy_qd80000gn/T/pip-install-puv5x7oh/spatial-correlation-sampler/setup.py'"'"'; __file__='"'"'/private/var/folders/cw/7_q449q1001fzq0ttwsy_qd80000gn/T/pip-install-puv5x7oh/spatial-correlation-sampler/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: /private/var/folders/cw/7_q449q1001fzq0ttwsy_qd80000gn/T/pip-install-puv5x7oh/spatial-correlation-sampler/
    Complete output (13 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/cw/7_q449q1001fzq0ttwsy_qd80000gn/T/pip-install-puv5x7oh/spatial-correlation-sampler/setup.py", line 57, in <module>
        launch_setup()
      File "/private/var/folders/cw/7_q449q1001fzq0ttwsy_qd80000gn/T/pip-install-puv5x7oh/spatial-correlation-sampler/setup.py", line 40, in launch_setup
        extra_link_args=['-lgomp'])
      File "/anaconda3/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 476, in CUDAExtension
        library_dirs += library_paths(cuda=True)
      File "/anaconda3/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 555, in library_paths
        if (not os.path.exists(_join_cuda_home(lib_dir)) and
      File "/anaconda3/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1146, in _join_cuda_home
        raise EnvironmentError('CUDA_HOME environment variable is not set. '
    OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

最佳答案

由于声誉原因我无法发表评论,但是您安装了 CUDA 吗?运行时会发生什么

nvcc --version

在命令行中?

关于python - 命令出错,退出状态为 1 : python setup. py egg_info 检查日志以获取完整的命令输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58732467/

相关文章:

python - 使用 Python codecs.write 编写换行符

macos - -bash : pylint: command not found

python - 安装 pip 以导入模块

python - 为特定的 python 版本安装 pip

python - 通过 Python 中的函数传递值

python - 将两个数据框与其中一列内的列表合并

python - Django - 如何将自定义对象分配为模型属性并在该对象中获取该模型实例?

python - Flask-Marshmallow 模式上的验证错误

python - 在 C++ 应用程序中嵌入 python 环境

python - 如何创建虚拟文件作为内存缓冲区