Skip to content

Commit

Permalink
bugfix: setup.py - Force pip for imagio-ffmpeg
Browse files Browse the repository at this point in the history
  • Loading branch information
torzdf committed Nov 17, 2023
1 parent 4557331 commit a62a85c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from lib.logger import log_setup

logger = logging.getLogger(__name__) # pylint: disable=invalid-name
backend_type: T.TypeAlias = T.Literal['nvidia', 'apple_silicon', 'directml', 'cpu', 'rocm']
backend_type: T.TypeAlias = T.Literal['nvidia', 'apple_silicon', 'directml', 'cpu', 'rocm', "all"]

_INSTALL_FAILED = False
# Packages that are explicitly required for setup.py
Expand All @@ -34,7 +34,9 @@
"nvidia": ["cudatoolkit", "cudnn", "zlib-wapi"],
"apple_silicon": ["libblas"]}
# Packages that should only be installed through pip
_FORCE_PIP: dict[backend_type, list[str]] = {"nvidia": ["tensorflow"]}
_FORCE_PIP: dict[backend_type, list[str]] = {
"nvidia": ["tensorflow"],
"all": ["imageio-ffmpeg"]} # 17/11/23 Conda forge uses incorrect ffmpeg, so fallback to pip
# Revisions of tensorflow GPU and cuda/cudnn requirements. These relate specifically to the
# Tensorflow builds available from pypi
_TENSORFLOW_REQUIREMENTS = {">=2.10.0,<2.11.0": [">=11.0,<12.0", ">=8.0,<9.0"]}
Expand All @@ -46,7 +48,7 @@
_CONDA_MAPPING: dict[str, tuple[str, str]] = {
"fastcluster": ("fastcluster", "conda-forge"),
"ffmpy": ("ffmpy", "conda-forge"),
"imageio-ffmpeg": ("imageio-ffmpeg", "conda-forge"),
# "imageio-ffmpeg": ("imageio-ffmpeg", "conda-forge"),
"nvidia-ml-py": ("nvidia-ml-py", "conda-forge"),
"tensorflow-deps": ("tensorflow-deps", "apple"),
"libblas": ("libblas", "conda-forge"),
Expand Down Expand Up @@ -1063,7 +1065,7 @@ def _install_python_packages(self) -> None:
mapping = _CONDA_MAPPING.get(pkg, (pkg, ""))
channel = "" if mapping[1] is None else mapping[1]
pkg = mapping[0]
pip_only = pkg in _FORCE_PIP.get(self._env.backend, [])
pip_only = pkg in _FORCE_PIP.get(self._env.backend, []) or pkg in _FORCE_PIP["all"]
pkg = self._format_package(pkg, version) if version else pkg
if self._env.is_conda and not pip_only:
if self._from_conda(pkg, channel=channel, conda_only=conda_only):
Expand Down

1 comment on commit a62a85c

@gakokaka
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

h

Please sign in to comment.