python - 无法 pip 安装手电筒

标签 python installation pip torch stanza

我正在尝试 pip install stanza 并收到此消息:

ERROR: No matching distribution found for torch>=1.3.0 (from stanza)

然后我运行 pip install torch 并得到以下结果(该网站不允许我包含太多代码,所以 here's the full error)

  ERROR: Command errored out with exit status 1:
   command: 'c:\python\python37\python.exe' ... ...
  ...  ...
  Traceback (most recent call last):
    ... ...
    File "C:\Users\borka\AppData\Local\Temp\pip-install-10i7vgad\torch\setup.py", line 51, in run
      from tools.nnwrap import generate_wrappers as generate_nn_wrappers
  ModuleNotFoundError: No module named 'tools.nnwrap'
  ----------------------------------------
  ERROR: Failed building wheel for torch
  ERROR: Command errored out with exit status 1:
   command: 'c:\python\python37\python.exe' ... ...
       cwd: C:\Users\borka\AppData\Local\Temp\pip-install-10i7vgad\torch
  Complete output (2 lines):
  running clean
  error: [Errno 2] No such file or directory: '.gitignore'
  ----------------------------------------
  ERROR: Failed cleaning build dir for torch
DEPRECATION: Could not build wheels for torch which do not use PEP 517. pip will fall back to legacy 'setup.py install' for these. pip 21.0 will remove support for this functionality. A possible replacement is to fix the wheel build issue reported above. You can find discussion regarding this at https://github.com/pypa/pip/issues/8368.
    ERROR: Command errored out with exit status 1:
     command: 'c:\python\python37\python.exe' ... ...
    Traceback (most recent call last):
    ... ...
      File "C:\Users\borka\AppData\Local\Temp\pip-install-10i7vgad\torch\setup.py", line 51, in run
        from tools.nnwrap import generate_wrappers as generate_nn_wrappers
    ModuleNotFoundError: No module named 'tools.nnwrap'
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\python\python37\python.exe' ... ... Check the logs for full command output.

最佳答案

我可以看到你有一台 Windows 机器,所以来自 this official pytorch网站,您可以构建最适合您的要求和系统的命令,试试这个

pip install torch===1.6.0 torchvision===0.7.0 -f https://download.pytorch.org/whl/torch_stable.html

here ,所有 torch 包都位于 Windows、MacOS 和 Linux 中

关于python - 无法 pip 安装手电筒,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63469422/

相关文章:

python - 用Python下载的图片损坏了?

python - 我应该将 Django 管理静态文件添加到我的 git 仓库中吗?

python - Hackerrank Quest——错误还是误解?

python - setup.py 在 vi​​rtualenv 中的什么位置安装数据文件?

python - 如何配置不需要sudo的虚拟环境?

python - CouchDB-Python:如何使用 “_show” 和 “_list” 函数?

Linux:如何 headless (headless)安装旧版本的 VLC?

python - 使安装新的Python次要版本而不是之前的版本

ios - 找不到“UIImageView+AFNetworking.h”文件

python - 在 Windows 上的 Python 中导入 TensorFlow 时出错