question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`pip install torchvision` started failing

See original GitHub issue

🐛 Describe the bug

We have a GitHub action workflow in our library AugLy which runs automatically when a PR is updated. This workflow suddenly started failing on the line pip install pyre-check pytest torchvision. See here a run of the workflow which succeeded 2 days ago & here the one that fails today. Looking at the error message & output (pasted below), this seems to be due to an error while installing torchvision.

Full error message:

Run pip install pyre-check pytest torchvision
Collecting pyre-check
  Downloading pyre_check-0.9.6-py3-none-manylinux1_x86_64.whl (18.7 MB)
Collecting pytest
  Downloading pytest-6.2.5-py3-none-any.whl (280 kB)
Collecting torchvision
  Downloading torchvision-0.2.2.post3-py2.py3-none-any.whl (64 kB)
Collecting tabulate
  Downloading tabulate-0.8.9-py3-none-any.whl (25 kB)
Collecting async-generator
  Downloading async_generator-1.10-py3-none-any.whl (18 kB)
Collecting libcst>=0.3.6
  Downloading libcst-0.3.21-py3-none-any.whl (514 kB)
Collecting typing-extensions
  Downloading typing_extensions-3.10.0.2-py3-none-any.whl (26 kB)
Collecting click
  Downloading click-8.0.3-py3-none-any.whl (97 kB)
Collecting psutil
  Downloading psutil-5.8.0.tar.gz (470 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Collecting pyre-extensions
  Downloading pyre_extensions-0.0.22-py3-none-any.whl (10 kB)
Collecting dataclasses-json
  Downloading dataclasses_json-0.5.6-py3-none-any.whl (25 kB)
Collecting pywatchman
  Downloading pywatchman-1.4.1.tar.gz (29 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Collecting iniconfig
  Downloading iniconfig-1.1.1-py2.py3-none-any.whl (5.0 kB)
Collecting packaging
  Downloading packaging-21.0-py3-none-any.whl (40 kB)
Collecting py>=1.8.2
  Downloading py-1.10.0-py2.py3-none-any.whl (97 kB)
Collecting toml
  Downloading toml-0.10.2-py2.py3-none-any.whl (16 kB)
Collecting attrs>=19.2.0
  Downloading attrs-21.2.0-py2.py3-none-any.whl (53 kB)
Collecting pluggy<2.0,>=0.12
  Downloading pluggy-1.0.0-py2.py3-none-any.whl (13 kB)
Collecting numpy
  Downloading numpy-1.21.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (15.9 MB)
Collecting pillow>=4.1.1
  Downloading Pillow-8.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB)
Collecting six
  Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting torch
  Downloading torch-0.1.2.post2.tar.gz (128 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Collecting typing-inspect>=0.4.0
  Downloading typing_inspect-0.7.1-py3-none-any.whl (8.4 kB)
Collecting pyyaml>=5.2
  Downloading PyYAML-6.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (682 kB)
Collecting marshmallow<4.0.0,>=3.3.0
  Downloading marshmallow-3.14.0-py3-none-any.whl (47 kB)
Collecting marshmallow-enum<2.0.0,>=1.5.1
  Downloading marshmallow_enum-1.5.1-py2.py3-none-any.whl (4.2 kB)
Collecting pyparsing>=2.0.2
  Downloading pyparsing-2.4.7-py2.py3-none-any.whl (67 kB)
Collecting mypy-extensions>=0.3.0
  Downloading mypy_extensions-0.4.3-py2.py3-none-any.whl (4.5 kB)
WARNING: The candidate selected for download or install is a yanked version: 'torch' candidate (version 0.1.2.post2 at https://files.pythonhosted.org/packages/f8/02/880b468bd382dc79896eaecbeb8ce95e9c4b99a24902874a2cef0b562cea/torch-0.1.2.post2.tar.gz#sha256=a43e37f8f927c5b18f80cd163daaf6a1920edafcab5102e02e3e14bb97d9c874 (from https://pypi.org/simple/torch/))
Using legacy 'setup.py install' for psutil, since package 'wheel' is not installed.
Reason for being yanked: 0.1.2 is past it's support date and confuses users on unsupported platforms
Using legacy 'setup.py install' for pywatchman, since package 'wheel' is not installed.
Using legacy 'setup.py install' for torch, since package 'wheel' is not installed.
Installing collected packages: typing-extensions, mypy-extensions, marshmallow, typing-inspect, pyyaml, pyparsing, marshmallow-enum, torch, toml, tabulate, six, pywatchman, pyre-extensions, py, psutil, pluggy, pillow, packaging, numpy, libcst, iniconfig, dataclasses-json, click, attrs, async-generator, torchvision, pytest, pyre-check
    Running setup.py install for torch: started
    ERROR: Command errored out with exit status 1:
     command: /opt/hostedtoolcache/Python/3.10.0/x64/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-qe9j63_3/torch_5d1ebf10fc5746f189a34b48c834f044/setup.py'"'"'; __file__='"'"'/tmp/pip-install-qe9j63_3/torch_5d1ebf10fc5746f189a34b48c834f044/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-ej81pbk2/install-record.txt --single-version-externally-managed --compile --install-headers /opt/hostedtoolcache/Python/3.10.0/x64/include/python3.10/torch
         cwd: /tmp/pip-install-qe9j63_3/torch_5d1ebf10fc5746f189a34b48c834f044/
    Complete output (23 lines):
    running install
    running build_deps
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-qe9j63_3/torch_5d1ebf10fc5746f189a34b48c834f044/setup.py", line 225, in <module>
        setup(name="torch", version="0.1.2.post2",
      File "/opt/hostedtoolcache/Python/3.10.0/x64/lib/python3.10/site-packages/setuptools/__init__.py", line 153, in setup
        return distutils.core.setup(**attrs)
      File "/opt/hostedtoolcache/Python/3.10.0/x64/lib/python3.10/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/opt/hostedtoolcache/Python/3.10.0/x64/lib/python3.10/distutils/dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "/opt/hostedtoolcache/Python/3.10.0/x64/lib/python3.10/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/tmp/pip-install-qe9j63_3/torch_5d1ebf10fc5746f189a34b48c834f044/setup.py", line 99, in run
        self.run_command('build_deps')
      File "/opt/hostedtoolcache/Python/3.10.0/x64/lib/python3.10/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/opt/hostedtoolcache/Python/3.10.0/x64/lib/python3.10/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/tmp/pip-install-qe9j63_3/torch_5d1ebf10fc5746f189a34b48c834f044/setup.py", line 51, in run
        from tools.nnwrap import generate_wrappers as generate_nn_wrappers
    ModuleNotFoundError: No module named 'tools.nnwrap'
    ----------------------------------------
    Running setup.py install for torch: finished with status 'error'
ERROR: Command errored out with exit status 1: /opt/hostedtoolcache/Python/3.10.0/x64/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-qe9j63_3/torch_5d1ebf10fc5746f189a34b48c834f044/setup.py'"'"'; __file__='"'"'/tmp/pip-install-qe9j63_3/torch_5d1ebf10fc5746f189a34b48c834f044/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-ej81pbk2/install-record.txt --single-version-externally-managed --compile --install-headers /opt/hostedtoolcache/Python/3.10.0/x64/include/python3.10/torch Check the logs for full command output.
Error: Process completed with exit code 1.

Versions

I can’t run this since it’s through a GitHub workflow.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
NicolasHugcommented, Oct 22, 2021

Thanks for investigating, indeed 3.10 isn’t supported by pytorch yet 😃

1reaction
jbittoncommented, Oct 22, 2021

So I looked into what was the difference between our workflows from 3 days ago (which passed) and our newer ones that failed – the difference was that in our newer workflows GitHub started to download python 3.10 as opposed to 3.9.7. For some reason, it seems as if newer versions of torch/torchvision are not available in 3.10 (as soon as we specified to use python 3.9 we were able to find & download torchvision 0.11).

[edit] feel free to close this issue if it is expected behavior for newer torch versions to be unavailable in 3.10! our use case is unblocked for now 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error in pip install torchvision on Windows 10 - Stack Overflow
I tried to use: pip install torchvision. but it didn't work for me. So, I googled this problem more carefully and found another...
Read more >
can't install latest version of torchvision using pip ... - GitHub
When I try to install torchvision using pip, I expect it to install the latest version: 0.11.1 . However, it will only install...
Read more >
Previous PyTorch Versions
An open source machine learning framework that accelerates the path from research prototyping to production deployment.
Read more >
Error installing Pytorch - Visual Studio Feedback
Building wheel for torch (setup.py): started ... cwd: C:\Users\MIZQUI~1\AppData\Local\Temp\pip-install-49hzjhen\torch ... Failed to build torch. Installing ...
Read more >
torchvision - PyPI
pip: pip install torchvision. From source: python setup.py install # or, ... In case building TorchVision from source fails, install the nightly version...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found