Fix compatibility with setuptools ≥ 82 and PyTorch ≥ 2.6#264
Draft
Fix compatibility with setuptools ≥ 82 and PyTorch ≥ 2.6#264
Conversation
…ls>=82 Co-authored-by: fcakyon <34196005+fcakyon@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix issue with YOLOv5 installation instructions
Replace pkg_resources with packaging.version
Mar 20, 2026
…tibility Co-authored-by: fcakyon <34196005+fcakyon@users.noreply.github.com> Agent-Logs-Url: https://github.com/fcakyon/yolov5-pip/sessions/2162a879-c7ca-4877-8387-36c5cf4ed431
Copilot
AI
changed the title
Replace pkg_resources with packaging.version
Fix compatibility with setuptools ≥ 82 and PyTorch ≥ 2.6
Mar 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two upstream breaking changes rendered the package non-functional:
pkg_resourceswas removed fromsetuptoolsin v82, and PyTorch 2.6 flippedtorch.load'sweights_onlydefault fromFalsetoTrue.Changes
pkg_resources→packaging.version(yolov5/utils/general.py,yolov5/utils/loggers/__init__.py)Added
packaging>=21.0torequirements.txt.torch.loadweights_only — addedweights_only=Falseto all 7 call sites across 5 files (models/experimental.py,train.py,hubconf.py,utils/general.py,segment/train.py). YOLOv5 checkpoints contain custom Python globals (models.yolo.Model) that are incompatible withweights_only=True.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
dns.google/usr/bin/python python -c import yolov5.utils.general(dns block)/usr/bin/python python -m unittest(dns block)/usr/bin/python python -m unittest tests.test_yolov5.TestYolov5FromUltralytics(dns block)https://api.github.com/repos/ultralytics/yolov5/releases/latest/usr/bin/python python -m unittest(http block)/usr/bin/python python -m unittest tests.test_yolov5.TestYolov5FromUltralytics(http block)https://api.github.com/repos/ultralytics/yolov5/releases/tags/v7.0/usr/bin/python python -m unittest(http block)/usr/bin/python python -m unittest tests.test_yolov5.TestYolov5FromUltralytics(http block)huggingface.co/usr/bin/python python -m unittest(dns block)one.one.one.one/usr/bin/python python -c import yolov5.utils.general(dns block)/usr/bin/python python -m unittest(dns block)/usr/bin/python python -m unittest tests.test_yolov5.TestYolov5FromUltralytics(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.