          condaexe = ["conda", "install", "-y"]
          if channel:
              condaexe.extend(["-c", channel])
  
          if package.startswith("tensorflow-gpu"):
              # Here we will install the cuda/cudnn toolkits, currently only available from
              # conda-forge, but fail tensorflow itself so that it can be handled by pip.
              specs = Requirement.parse(package).specs
              for key, val in _TENSORFLOW_REQUIREMENTS.items():
                  req_specs = Requirement.parse("foobar" + key).specs
                  if all(item in req_specs for item in specs):
                      cuda, cudnn = val
                      break
              condaexe.extend(["-c", "conda-forge", f"cudatoolkit={cuda}", f"cudnn={cudnn}"])
              package = "Cuda Toolkit"
              success = False
  
          if package != "Cuda Toolkit":
              if any(char in package for char in (" ", "<", ">", "*", "|")):
                  package = f"\"{package}\""
              condaexe.append(package)
  
          clean_pkg = package.replace("\"", "")
          installer = self._installer(self._env, clean_pkg, condaexe, self._is_gui)
          retcode = installer()
  
 
</s> remove             cuda_req = val[0]
            cudnn_req = val[1].split(".")
            if cuda_req == self._env.cuda_version and (cudnn_req[0] == cudnn_inst[0] and
                                                       cudnn_req[1] <= cudnn_inst[1]):
 </s> add             cuda_req = next(parse_requirements(f"cuda{val[0]}")).specs
            cudnn_req = next(parse_requirements(f"cudnn{val[1]}")).specs
            if (self._validate_spec(cuda_req, cuda_inst)
                    and self._validate_spec(cudnn_req, cudnn_inst)): </s> remove         cudnn_inst = self._env.cudnn_version.split(".")
 </s> add         cuda_inst = self._env.cuda_version
        cudnn_inst = self._env.cudnn_version
        if len(cudnn_inst) == 1:  # Sometimes only major version is reported
            cudnn_inst = f"{cudnn_inst}.0" </s> remove     def _parse_lines(self) -> None:
        """ Process the latest batch of lines that have been received from winPTY. """
        for line in self._lines:  # Dump the output to log
            line = line.rstrip()
            is_cr = bool(self._pbar.search(line))
            if line and not is_cr:
                if self._last_line_cr:
                    self._last_line_cr = False
                    if not self._env.is_installer:
                        # Go to next line
                        self._non_gui_print("")
                self._seen_line_log(line)
            elif line:
                self._last_line_cr = True
                logger.debug(line)
                # NSIS only updates on line endings, so force new line for installer
                self._non_gui_print(line, end=None if self._env.is_installer else "\r")
        self._lines = []

 </s> add  </s> remove             if self._env.is_conda:
                if pkg.startswith("tensorflow-gpu"):
                    # From TF 2.4 onwards, Anaconda Tensorflow becomes a mess. The version of 2.5
                    # installed by Anaconda is compiled against an incorrect numpy version which
                    # breaks Tensorflow. Coupled with this the versions of cudatoolkit and cudnn
                    # available in the default Anaconda channel are not compatible with the
                    # official PyPi versions of Tensorflow. With this in mind we will pull in the
                    # required Cuda/cuDNN from conda-forge, and install Tensorflow with pip
                    # TODO Revert to Conda if they get their act together

                    # Rewrite tensorflow requirement to versions from highest available cuda/cudnn
                    highest_cuda = sorted(_TENSORFLOW_REQUIREMENTS.values())[-1]
                    compat_tf = next(k for k, v in _TENSORFLOW_REQUIREMENTS.items()
                                     if v == highest_cuda)
                    pkg = f"tensorflow-gpu{compat_tf}"
                    conda_only = True

 </s> add             if self._env.is_conda and not pip_only:
        if any(char in package for char in (" ", "<", ">", "*", "|")):
            package = f"\"{package}\""
        condaexe.append(package)
          condaexe = ["conda", "install", "-y"]
          if channel:
              condaexe.extend(["-c", channel])
  
        if any(char in package for char in (" ", "<", ">", "*", "|")):
            package = f"\"{package}\""
        condaexe.append(package)
        if any(char in package for char in (" ", "<", ">", "*", "|")):
            package = f"\"{package}\""
        condaexe.append(package)
        if any(char in package for char in (" ", "<", ">", "*", "|")):
            package = f"\"{package}\""
        condaexe.append(package)
        if any(char in package for char in (" ", "<", ">", "*", "|")):
            package = f"\"{package}\""
        condaexe.append(package)
        if any(char in package for char in (" ", "<", ">", "*", "|")):
            package = f"\"{package}\""
        condaexe.append(package)
        if any(char in package for char in (" ", "<", ">", "*", "|")):
            package = f"\"{package}\""
        condaexe.append(package)
        if any(char in package for char in (" ", "<", ">", "*", "|")):
            package = f"\"{package}\""
        condaexe.append(package)
        if any(char in package for char in (" ", "<", ">", "*", "|")):
            package = f"\"{package}\""
        condaexe.append(package)
        if any(char in package for char in (" ", "<", ">", "*", "|")):
            package = f"\"{package}\""
        condaexe.append(package)
        if any(char in package for char in (" ", "<", ">", "*", "|")):
            package = f"\"{package}\""
        condaexe.append(package)
        if any(char in package for char in (" ", "<", ">", "*", "|")):
            package = f"\"{package}\""
        condaexe.append(package)
        if any(char in package for char in (" ", "<", ">", "*", "|")):
            package = f"\"{package}\""
        condaexe.append(package)
        if any(char in package for char in (" ", "<", ">", "*", "|")):
            package = f"\"{package}\""
        condaexe.append(package)
        if any(char in package for char in (" ", "<", ">", "*", "|")):
            package = f"\"{package}\""
        condaexe.append(package)
        if any(char in package for char in (" ", "<", ">", "*", "|")):
            package = f"\"{package}\""
        condaexe.append(package)
        if any(char in package for char in (" ", "<", ">", "*", "|")):
            package = f"\"{package}\""
        condaexe.append(package)
        if any(char in package for char in (" ", "<", ">", "*", "|")):
            package = f"\"{package}\""
        condaexe.append(package)
  
          clean_pkg = package.replace("\"", "")
          installer = self._installer(self._env, clean_pkg, condaexe, self._is_gui)
          retcode = installer()
  
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 Rebase code (#1326)

* Remove tensorflow_probability requirement

* setup.py - fix progress bars

* requirements.txt: Remove pre python 3.9 packages

* update apple requirements.txt

* update INSTALL.md

* Remove python<3.9 code

* setup.py - fix Windows Installer

* typing: python3.9 compliant

* Update pytest and readthedocs python versions

* typing fixes

* Python Version updates
  - Reduce max version to 3.10
  - Default to 3.10 in installers
  - Remove incompatible 3.11 tests

* Update dependencies

* Downgrade imageio dep for Windows

* typing: merge optional unions and fixes

* Updates
  - min python version 3.10
  - typing to python 3.10 spec
  - remove pre-tf2.10 code
  - Add conda tests

* train: re-enable optimizer saving

* Update dockerfiles

* Update setup.py
  - Apple Conda deps to setup.py
  - Better Cuda + dependency handling

* bugfix: Patch logging to prevent Autograph errors

* Update dockerfiles

* Setup.py - Setup.py - stdout to utf-8

* Add more OSes to github Actions

* suppress mac-os end to end test 
setup.py