Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,25 @@ For desktop features, use:
pip install "roboflow[desktop]"
```

### Compatibility notes

- OpenCV is required. This package uses `opencv-python(-headless)>=4.10.0.84`.
- NumPy selection depends on Python version:
- Python 3.8–3.9: `numpy>=1.26,<2`.
- Python 3.10+: `numpy>=2`.

If you installed an incompatible NumPy previously, reinstall with one of the following:

```bash
# Python 3.8–3.9
pip install --upgrade --force-reinstall "numpy>=1.26,<2" "opencv-python-headless>=4.10.0.84"

# Python 3.10+
pip install --upgrade "numpy>=2" "opencv-python-headless>=4.10.0.84"
```

If you use the `desktop` extra, it will install `opencv-python>=4.10.0.84`.


<details>
<summary>Install from source</summary>
Expand Down
9 changes: 7 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@ idna==3.7
cycler
kiwisolver>=1.3.1
matplotlib
numpy>=1.18.5
opencv-python-headless==4.10.0.84
# NumPy and OpenCV compatibility:
# - For Python < 3.10, stick to NumPy 1.26.x (NumPy 2.x does not provide wheels)
# - For Python >= 3.10, allow NumPy 2.x
# - Keep OpenCV mandatory and allow latest compatible wheels
numpy>=1.26,<2; python_version < "3.10"
numpy>=2; python_version >= "3.10"
opencv-python-headless>=4.10.0.84
Pillow>=7.1.2
# https://github.com/roboflow/roboflow-python/issues/390
pi-heif<2
Expand Down
14 changes: 12 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
long_description = fh.read()

with open("requirements.txt") as fh:
install_requires = fh.read().split("\n")
install_requires = [
line.strip() for line in fh.read().split("\n") if line.strip() and not line.strip().startswith("#")
]

setuptools.setup(
name="roboflow",
Expand All @@ -29,7 +31,10 @@
packages=find_packages(exclude=("tests",)),
# create optional [desktop]
extras_require={
"desktop": ["opencv-python==4.8.0.74"],
# Keep OpenCV mandatory in desktop extra across versions
"desktop": [
"opencv-python>=4.10.0.84",
],
"dev": [
"mypy",
"responses",
Expand All @@ -49,6 +54,11 @@
},
classifiers=[
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
],
Expand Down
Loading