roboflow / roboflow/roboflow-python

Issue: ImportError downloading dataset due to unsupported ultralytics version

Open
#251 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
629
Forks
140
Avg merge
2d 2h
Merged PRs (30d)
5

Description

Description

When attempting to download a dataset using Roboflow's Python package, an ImportError occurs due to a dependency version mismatch with the ultralytics package.

Steps to Reproduce

Click on custom train option and execute recommended code using Roboflow's API:

from roboflow import Roboflow
rf = Roboflow(api_key="MY_API_KEY")
project = rf.workspace("myworkspace").project("myproject")
version = project.version(1)
dataset = version.download("yolov8")
Expected Behavior

The dataset should download without any issues, and the script should handle dependencies smoothly, even with newer versions of ultralytics.

Actual Behavior

The script throws an ImportError, stating a dependency version mismatch:

loading Roboflow workspace...
Dependency ultralytics==8.0.196 is required but found version=8.2.2, to fix: `pip install ultralytics==8.0.196`
Proposed Solution

It would be beneficial for compatibility and future-proofing to support newer versions of ultralytics or at least allow the downloading with a version warning. If possible, updating the dependency requirements or making the version checks more flexible could resolve this issue.

Temporary solution

I added the ask_to_continue argument and set it to True in Version.download method:

...
if model_format == "yolov8":
    # if ultralytics is installed, we will assume users will want to use yolov8 and we check for the supported version  # noqa: E501 // docs
    try:
        import_module("ultralytics")
        print_warn_for_wrong_dependencies_versions([("ultralytics", "==", "8.0.196")], ask_to_continue=True)
    except ImportError:
        print(
            "[WARNING] we noticed you are downloading a `yolov8` datasets but you don't have `ultralytics` installed. "  # noqa: E501 // docs
            "Roboflow `.deploy` supports only models trained with `ultralytics==8.0.196`, to intall it `pip install ultralytics==8.0.196`."  # noqa: E501 // docs
        )
        # silently fail
        pass
...
loading Roboflow workspace...
loading Roboflow project...
Dependency ultralytics==8.0.196 is required but found version=8.2.2, to fix: `pip install ultralytics==8.0.196`
Would you like to continue with the wrong version of ultralytics? y/n: y

Dataset is downlaoded

Additional Information

Python Version: 3.10
Operating System: Windows 10
ultralytics Version: 8.2.2

Thanks :)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the Version.download method's yolov8 branch and inspect how print_warn_for_wrong_dependencies_versions handles the ultralytics requirement. Compare the current strict version check with the reported ask_to_continue behavior, then verify that dataset downloads complete with newer ultralytics versions while the deployment compatibility warning remains accurate.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-vision, machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.