Skip to content

Commit c943f74

Browse files
authored
Don't require opencv-python if opencv is already installed (#110)
This will allow us to get rid of py-opencv-python in our Spack deployment
1 parent 51cfac0 commit c943f74

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

setup.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
"dataclasses; python_version < '3.7'",
2626
"matplotlib",
2727
"numpy",
28-
"opencv-python",
2928
"requests",
3029
"scikit-image",
3130
]
@@ -46,6 +45,12 @@
4645
"docs": ["sphinx>=1.3", "sphinx-bluebrain-theme"],
4746
}
4847

48+
try:
49+
# Could already be installed on the system
50+
import cv2 # noqa
51+
except ImportError:
52+
install_requires.append("opencv-python")
53+
4954
description = "Search, download, and prepare atlas data."
5055
long_description = """
5156
Among different sources of data, Allen Brain Institute

0 commit comments

Comments
 (0)