prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Unclear what extras to install: `import nni.retiarii.execution.api` fails due to missing `pytorch_lightning`
  **Describe the issue**:
  I want to use `nni.retiarii.execution.api` module. I've installed it as below:
  ```
  Collecting nni>=2.3
    Downloading nni-2.9-py3-none-manylinux1_x86_64.whl (56.0 MB)
  ```
  
  **Environment**:
  - NNI version: 2.9
  - Python version: 3.8
  
  **Log message**:
  ```
  _________________ ERROR collecting test/3rd_party/test_nni.py __________________
  ImportError while importing test module '/__w/ai4cl-tianshou/ai4cl-tianshou/test/3rd_party/test_nni.py'.
  Hint: make sure your test modules/packages have valid Python names.
  Traceback:
  /usr/local/lib/python3.8/importlib/__init__.py:127: in import_module
      return _bootstrap._gcd_import(name[level:], package, level)
  test/3rd_party/test_nni.py:8: in <module>
      import nni.retiarii.execution.api
  /usr/local/lib/python3.8/site-packages/nni/retiarii/__init__.py:4: in <module>
      from .operation import Operation
  /usr/local/lib/python3.8/site-packages/nni/retiarii/operation.py:6: in <module>
      from nni.nas.execution.common.graph_op import *
  /usr/local/lib/python3.8/site-packages/nni/nas/__init__.py:4: in <module>
      from .execution import *
  /usr/local/lib/python3.8/site-packages/nni/nas/execution/__init__.py:4: in <module>
      from .api import *
  /usr/local/lib/python3.8/site-packages/nni/nas/execution/api.py:9: in <module>
      from nni.nas.execution.common import (
  /usr/local/lib/python3.8/site-packages/nni/nas/execution/common/__init__.py:4: in <module>
      from .engine import *
  /usr/local/lib/python3.8/site-packages/nni/nas/execution/common/engine.py:7: in <module>
      from .graph import Model, MetricData
  /usr/local/lib/python3.8/site-packages/nni/nas/execution/common/graph.py:18: in <module>
      from nni.nas.evaluator import Evaluator
  /usr/local/lib/python3.8/site-packages/nni/nas/evaluator/__init__.py:9: in <module>
      shortcut_framework(__name__)
  /usr/local/lib/python3.8/site-packages/nni/common/framework.py:93: in shortcut_framework
      shortcut_module(current, '.' + get_default_framework(), current)
  /usr/local/lib/python3.8/site-packages/nni/common/framework.py:83: in shortcut_module
      mod = importlib.import_module(target, package)
  /usr/local/lib/python3.8/importlib/__init__.py:127: in import_module
      return _bootstrap._gcd_import(name[level:], package, level)
  /usr/local/lib/python3.8/site-packages/nni/nas/evaluator/pytorch/__init__.py:4: in <module>
      from .lightning import *
  /usr/local/lib/python3.8/site-packages/nni/nas/evaluator/pytorch/lightning.py:10: in <module>
      import pytorch_lightning as pl
  E   ModuleNotFoundError: No module named 'pytorch_lightning'
  ```
  
  **How to reproduce it?**:
  ```
  pip install nni==2.9
  python -c "import nni.retiarii.execution.api"
  ```
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `nni/nas/evaluator/pytorch/__init__.py`
  Content:
  ```
  1 # Copyright (c) Microsoft Corporation.
  2 # Licensed under the MIT license.
  3 
  4 from .lightning import *
  5
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/nni/nas/evaluator/pytorch/__init__.py b/nni/nas/evaluator/pytorch/__init__.py
  --- a/nni/nas/evaluator/pytorch/__init__.py
  +++ b/nni/nas/evaluator/pytorch/__init__.py
  @@ -1,4 +1,11 @@
   # Copyright (c) Microsoft Corporation.
   # Licensed under the MIT license.
   
  -from .lightning import *
  +import warnings
  +
  +try:
  +    from .lightning import *
  +except ImportError:
  +    warnings.warn("PyTorch-Lightning must be installed to use PyTorch in NAS. "
  +                  "If you are not using PyTorch, please `nni.set_default_framework('none')`")
  +    raise
  
verification_info: {"golden_diff": "diff --git a/nni/nas/evaluator/pytorch/__init__.py b/nni/nas/evaluator/pytorch/__init__.py\n--- a/nni/nas/evaluator/pytorch/__init__.py\n+++ b/nni/nas/evaluator/pytorch/__init__.py\n@@ -1,4 +1,11 @@\n # Copyright (c) Microsoft Corporation.\n # Licensed under the MIT license.\n \n-from .lightning import *\n+import warnings\n+\n+try:\n+    from .lightning import *\n+except ImportError:\n+    warnings.warn(\"PyTorch-Lightning must be installed to use PyTorch in NAS. \"\n+                  \"If you are not using PyTorch, please `nni.set_default_framework('none')`\")\n+    raise\n", "issue": "Unclear what extras to install: `import nni.retiarii.execution.api` fails due to missing `pytorch_lightning`\n**Describe the issue**:\r\nI want to use `nni.retiarii.execution.api` module. I've installed it as below:\r\n```\r\nCollecting nni>=2.3\r\n  Downloading nni-2.9-py3-none-manylinux1_x86_64.whl (56.0 MB)\r\n```\r\n\r\n**Environment**:\r\n- NNI version: 2.9\r\n- Python version: 3.8\r\n\r\n**Log message**:\r\n```\r\n_________________ ERROR collecting test/3rd_party/test_nni.py __________________\r\nImportError while importing test module '/__w/ai4cl-tianshou/ai4cl-tianshou/test/3rd_party/test_nni.py'.\r\nHint: make sure your test modules/packages have valid Python names.\r\nTraceback:\r\n/usr/local/lib/python3.8/importlib/__init__.py:127: in import_module\r\n    return _bootstrap._gcd_import(name[level:], package, level)\r\ntest/3rd_party/test_nni.py:8: in <module>\r\n    import nni.retiarii.execution.api\r\n/usr/local/lib/python3.8/site-packages/nni/retiarii/__init__.py:4: in <module>\r\n    from .operation import Operation\r\n/usr/local/lib/python3.8/site-packages/nni/retiarii/operation.py:6: in <module>\r\n    from nni.nas.execution.common.graph_op import *\r\n/usr/local/lib/python3.8/site-packages/nni/nas/__init__.py:4: in <module>\r\n    from .execution import *\r\n/usr/local/lib/python3.8/site-packages/nni/nas/execution/__init__.py:4: in <module>\r\n    from .api import *\r\n/usr/local/lib/python3.8/site-packages/nni/nas/execution/api.py:9: in <module>\r\n    from nni.nas.execution.common import (\r\n/usr/local/lib/python3.8/site-packages/nni/nas/execution/common/__init__.py:4: in <module>\r\n    from .engine import *\r\n/usr/local/lib/python3.8/site-packages/nni/nas/execution/common/engine.py:7: in <module>\r\n    from .graph import Model, MetricData\r\n/usr/local/lib/python3.8/site-packages/nni/nas/execution/common/graph.py:18: in <module>\r\n    from nni.nas.evaluator import Evaluator\r\n/usr/local/lib/python3.8/site-packages/nni/nas/evaluator/__init__.py:9: in <module>\r\n    shortcut_framework(__name__)\r\n/usr/local/lib/python3.8/site-packages/nni/common/framework.py:93: in shortcut_framework\r\n    shortcut_module(current, '.' + get_default_framework(), current)\r\n/usr/local/lib/python3.8/site-packages/nni/common/framework.py:83: in shortcut_module\r\n    mod = importlib.import_module(target, package)\r\n/usr/local/lib/python3.8/importlib/__init__.py:127: in import_module\r\n    return _bootstrap._gcd_import(name[level:], package, level)\r\n/usr/local/lib/python3.8/site-packages/nni/nas/evaluator/pytorch/__init__.py:4: in <module>\r\n    from .lightning import *\r\n/usr/local/lib/python3.8/site-packages/nni/nas/evaluator/pytorch/lightning.py:10: in <module>\r\n    import pytorch_lightning as pl\r\nE   ModuleNotFoundError: No module named 'pytorch_lightning'\r\n```\r\n\r\n**How to reproduce it?**:\r\n```\r\npip install nni==2.9\r\npython -c \"import nni.retiarii.execution.api\"\r\n```\n", "before_files": [{"content": "# Copyright (c) Microsoft Corporation.\n# Licensed under the MIT license.\n\nfrom .lightning import *\n", "path": "nni/nas/evaluator/pytorch/__init__.py"}], "after_files": [{"content": "# Copyright (c) Microsoft Corporation.\n# Licensed under the MIT license.\n\nimport warnings\n\ntry:\n    from .lightning import *\nexcept ImportError:\n    warnings.warn(\"PyTorch-Lightning must be installed to use PyTorch in NAS. \"\n                  \"If you are not using PyTorch, please `nni.set_default_framework('none')`\")\n    raise\n", "path": "nni/nas/evaluator/pytorch/__init__.py"}]}