We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Version checker throws an error when manim is run without internet
## Description of bug / unexpected behavior
Title.


## Expected behavior
Version checker should just log that the version can't be checked, and not produce a traceback.


## How to reproduce the issue
<!-- Provide a piece of code illustrating the undesired behavior. -->

<details><summary>Code for reproducing the problem</summary>

```py
Paste your code here.
```

</details>


## Additional media files
<!-- Paste in the files manim produced on rendering the code above. -->

<details><summary>Images/GIFs</summary>

<!-- PASTE MEDIA HERE -->

</details>


## Logs
<details><summary>Terminal output</summary>
<!-- Add "-v DEBUG" when calling manim to generate more detailed logs -->

```
C:\Users\Daryl\manim-dev\manim>manim -p test.py
Manim Community v0.4.0

1: Become
2: BecomePoints
3: BecomePointsScene
4: BecomeStyle
5: BecomeStyle2
6: Image

Choose number corresponding to desired scene/arguments.
(Use comma separated list for multiple entries)
Choice(s):  6
[04/19/21 10:55:41] INFO                                                                        scene_file_writer.py:585
                             File ready at C:\Users\Daryl\manim-dev\manim\media\images\test\Ima
                             ge_ManimCE_v0.4.0.png

                    INFO     Rendered Image                                                                 scene.py:199
                             Played 0 animations
                    INFO     Previewed File at:                                                           file_ops.py:98
                             C:\Users\Daryl\manim-dev\manim\media\images\test\Image_ManimCE_v0.4.0.png
Traceback (most recent call last):
  File "C:\Users\Daryl\AppData\Local\pypoetry\Cache\virtualenvs\manim-WZ_QM4hs-py3.9\Scripts\manim", line 5, in <module>
    main()
  File "C:\Users\Daryl\AppData\Local\pypoetry\Cache\virtualenvs\manim-WZ_QM4hs-py3.9\lib\site-packages\click\core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "C:\Users\Daryl\AppData\Local\pypoetry\Cache\virtualenvs\manim-WZ_QM4hs-py3.9\lib\site-packages\click\core.py", line 782, in main
    rv = self.invoke(ctx)
  File "C:\Users\Daryl\AppData\Local\pypoetry\Cache\virtualenvs\manim-WZ_QM4hs-py3.9\lib\site-packages\click\core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\Users\Daryl\AppData\Local\pypoetry\Cache\virtualenvs\manim-WZ_QM4hs-py3.9\lib\site-packages\click\core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Users\Daryl\AppData\Local\pypoetry\Cache\virtualenvs\manim-WZ_QM4hs-py3.9\lib\site-packages\click\core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "C:\Users\Daryl\AppData\Local\pypoetry\Cache\virtualenvs\manim-WZ_QM4hs-py3.9\lib\site-packages\click\decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "C:\Users\Daryl\manim-dev\manim\manim\cli\render\commands.py", line 166, in render
    stable = req_info.json()["info"]["version"]
AttributeError: 'dict' object has no attribute 'json'
```

<!-- Insert screenshots here (only when absolutely necessary, we prefer copy/pasted output!) -->

</details>


## System specifications

<details><summary>System Details</summary>

- OS (with version, e.g Windows 10 v2004 or macOS 10.15 (Catalina)):
- RAM:
- Python version (`python/py/python3 --version`):
- Installed modules (provide output from `pip list`):
```
PASTE HERE
```
</details>

<details><summary>LaTeX details</summary>

+ LaTeX distribution (e.g. TeX Live 2020):
+ Installed LaTeX packages:
<!-- output of `tlmgr list --only-installed` for TeX Live or a screenshot of the Packages page for MikTeX -->
</details>

<details><summary>FFMPEG</summary>

Output of `ffmpeg -version`:

```
PASTE HERE
```
</details>

## Additional comments
<!-- Add further context that you think might be relevant for this issue here. -->


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `manim/cli/render/commands.py`
Content:
```
1 """Manim's default subcommand, render.
2 
3 Manim's render subcommand is accessed in the command-line interface via
4 ``manim``, but can be more explicitly accessed with ``manim render``. Here you
5 can specify options, and arguments for the render command.
6 
7 """
8 import json
9 import sys
10 from pathlib import Path
11 from textwrap import dedent
12 
13 import click
14 import cloup
15 import requests
16 
17 from ... import __version__, config, console, logger
18 from ...constants import CONTEXT_SETTINGS, EPILOG
19 from ...utils.exceptions import RerunSceneException
20 from ...utils.module_ops import scene_classes_from_file
21 from .ease_of_access_options import ease_of_access_options
22 from .global_options import global_options
23 from .output_options import output_options
24 from .render_options import render_options
25 
26 
27 @cloup.command(
28     context_settings=CONTEXT_SETTINGS,
29     epilog=EPILOG,
30 )
31 @click.argument("file", type=Path, required=True)
32 @click.argument("scene_names", required=False, nargs=-1)
33 @global_options
34 @output_options
35 @render_options
36 @ease_of_access_options
37 @click.pass_context
38 def render(
39     ctx,
40     **args,
41 ):
42     """Render SCENE(S) from the input FILE.
43 
44     FILE is the file path of the script.
45 
46     SCENES is an optional list of scenes in the file.
47     """
48     for scene in args["scene_names"]:
49         if str(scene).startswith("-"):
50             logger.warning(
51                 dedent(
52                     """\
53                 Manim Community has moved to Click for the CLI.
54 
55                 This means that options in the CLI are provided BEFORE the positional
56                 arguments for your FILE and SCENE(s):
57                 `manim render [OPTIONS] [FILE] [SCENES]...`
58 
59                 For example:
60                 New way - `manim -p -ql file.py SceneName1 SceneName2 ...`
61                 Old way - `manim file.py SceneName1 SceneName2 ... -p -ql`
62 
63                 To see the help page for the new available options, run:
64                 `manim render -h`
65                 """
66                 )
67             )
68             sys.exit()
69 
70     if args["use_opengl_renderer"]:
71         logger.warning(
72             "--use_opengl_renderer is deprecated, please use --renderer=opengl instead!"
73         )
74         renderer = "opengl"
75 
76     if args["use_webgl_renderer"]:
77         logger.warning(
78             "--use_webgl_renderer is deprecated, please use --renderer=webgl instead!"
79         )
80         renderer = "webgl"
81 
82     if args["use_webgl_renderer"] and args["use_opengl_renderer"]:
83         logger.warning("You may select only one renderer!")
84         sys.exit()
85 
86     class ClickArgs:
87         def __init__(self, args):
88             for name in args:
89                 setattr(self, name, args[name])
90 
91         def _get_kwargs(self):
92             return list(self.__dict__.items())
93 
94         def __eq__(self, other):
95             if not isinstance(other, ClickArgs):
96                 return NotImplemented
97             return vars(self) == vars(other)
98 
99         def __contains__(self, key):
100             return key in self.__dict__
101 
102         def __repr__(self):
103             return str(self.__dict__)
104 
105     click_args = ClickArgs(args)
106     if args["jupyter"]:
107         return click_args
108 
109     config.digest_args(click_args)
110     file = args["file"]
111     if config.renderer == "opengl":
112         from manim.renderer.opengl_renderer import OpenGLRenderer
113 
114         for SceneClass in scene_classes_from_file(file):
115             try:
116                 renderer = OpenGLRenderer()
117                 while True:
118                     scene_classes = scene_classes_from_file(file)
119                     SceneClass = scene_classes[0]
120                     scene = SceneClass(renderer)
121                     status = scene.render()
122                     if status:
123                         continue
124                     else:
125                         break
126             except Exception:
127                 console.print_exception()
128     elif config.renderer == "webgl":
129         try:
130             from manim.grpc.impl import frame_server_impl
131 
132             server = frame_server_impl.get(file)
133             server.start()
134             server.wait_for_termination()
135         except ModuleNotFoundError:
136             console.print(
137                 "Dependencies for the WebGL render are missing. Run "
138                 "pip install manim[webgl_renderer] to install them."
139             )
140             console.print_exception()
141     else:
142         for SceneClass in scene_classes_from_file(file):
143             try:
144                 scene = SceneClass()
145                 scene.render()
146             except Exception:
147                 console.print_exception()
148 
149     if config.notify_outdated_version:
150         manim_info_url = "https://pypi.org/pypi/manim/json"
151         warn_prompt = "Cannot check if latest release of manim is installed"
152         req_info = {}
153 
154         try:
155             req_info = requests.get(manim_info_url)
156             req_info.raise_for_status()
157         except requests.exceptions.HTTPError:
158             logger.debug(f"HTTP Error: {warn_prompt}")
159         except requests.exceptions.ConnectionError:
160             logger.debug(f"Connection Error: {warn_prompt}")
161         except requests.exceptions.Timeout:
162             logger.debug(f"Timed Out: {warn_prompt}")
163         except Exception:
164             logger.debug(f"Something went wrong: {warn_prompt}")
165 
166         try:
167             stable = req_info.json()["info"]["version"]
168 
169             if stable != __version__:
170                 console.print(
171                     f"You are using manim version [red]v{__version__}[/red], but version [green]v{stable}[/green] is available."
172                 )
173                 console.print(
174                     "You should consider upgrading via [yellow]pip install -U manim[/yellow]"
175                 )
176         except json.JSONDecodeError:
177             logger.debug(warn_prompt)
178             logger.debug(f"Error decoding JSON from {manim_info_url}")
179 
180     return args
181
```
--- 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()

```

diff --git a/manim/cli/render/commands.py b/manim/cli/render/commands.py
--- a/manim/cli/render/commands.py
+++ b/manim/cli/render/commands.py
@@ -154,18 +154,8 @@
         try:
             req_info = requests.get(manim_info_url)
             req_info.raise_for_status()
-        except requests.exceptions.HTTPError:
-            logger.debug(f"HTTP Error: {warn_prompt}")
-        except requests.exceptions.ConnectionError:
-            logger.debug(f"Connection Error: {warn_prompt}")
-        except requests.exceptions.Timeout:
-            logger.debug(f"Timed Out: {warn_prompt}")
-        except Exception:
-            logger.debug(f"Something went wrong: {warn_prompt}")
 
-        try:
             stable = req_info.json()["info"]["version"]
-
             if stable != __version__:
                 console.print(
                     f"You are using manim version [red]v{__version__}[/red], but version [green]v{stable}[/green] is available."
@@ -173,8 +163,16 @@
                 console.print(
                     "You should consider upgrading via [yellow]pip install -U manim[/yellow]"
                 )
+        except requests.exceptions.HTTPError:
+            logger.debug(f"HTTP Error: {warn_prompt}")
+        except requests.exceptions.ConnectionError:
+            logger.debug(f"Connection Error: {warn_prompt}")
+        except requests.exceptions.Timeout:
+            logger.debug(f"Timed Out: {warn_prompt}")
         except json.JSONDecodeError:
             logger.debug(warn_prompt)
             logger.debug(f"Error decoding JSON from {manim_info_url}")
+        except Exception:
+            logger.debug(f"Something went wrong: {warn_prompt}")
 
     return args

{"golden_diff": "diff --git a/manim/cli/render/commands.py b/manim/cli/render/commands.py\n--- a/manim/cli/render/commands.py\n+++ b/manim/cli/render/commands.py\n@@ -154,18 +154,8 @@\n         try:\n             req_info = requests.get(manim_info_url)\n             req_info.raise_for_status()\n-        except requests.exceptions.HTTPError:\n-            logger.debug(f\"HTTP Error: {warn_prompt}\")\n-        except requests.exceptions.ConnectionError:\n-            logger.debug(f\"Connection Error: {warn_prompt}\")\n-        except requests.exceptions.Timeout:\n-            logger.debug(f\"Timed Out: {warn_prompt}\")\n-        except Exception:\n-            logger.debug(f\"Something went wrong: {warn_prompt}\")\n \n-        try:\n             stable = req_info.json()[\"info\"][\"version\"]\n-\n             if stable != __version__:\n                 console.print(\n                     f\"You are using manim version [red]v{__version__}[/red], but version [green]v{stable}[/green] is available.\"\n@@ -173,8 +163,16 @@\n                 console.print(\n                     \"You should consider upgrading via [yellow]pip install -U manim[/yellow]\"\n                 )\n+        except requests.exceptions.HTTPError:\n+            logger.debug(f\"HTTP Error: {warn_prompt}\")\n+        except requests.exceptions.ConnectionError:\n+            logger.debug(f\"Connection Error: {warn_prompt}\")\n+        except requests.exceptions.Timeout:\n+            logger.debug(f\"Timed Out: {warn_prompt}\")\n         except json.JSONDecodeError:\n             logger.debug(warn_prompt)\n             logger.debug(f\"Error decoding JSON from {manim_info_url}\")\n+        except Exception:\n+            logger.debug(f\"Something went wrong: {warn_prompt}\")\n \n     return args\n", "issue": "Version checker throws an error when manim is run without internet\n## Description of bug / unexpected behavior\r\nTitle.\r\n\r\n\r\n## Expected behavior\r\nVersion checker should just log that the version can't be checked, and not produce a traceback.\r\n\r\n\r\n## How to reproduce the issue\r\n<!-- Provide a piece of code illustrating the undesired behavior. -->\r\n\r\n<details><summary>Code for reproducing the problem</summary>\r\n\r\n```py\r\nPaste your code here.\r\n```\r\n\r\n</details>\r\n\r\n\r\n## Additional media files\r\n<!-- Paste in the files manim produced on rendering the code above. -->\r\n\r\n<details><summary>Images/GIFs</summary>\r\n\r\n<!-- PASTE MEDIA HERE -->\r\n\r\n</details>\r\n\r\n\r\n## Logs\r\n<details><summary>Terminal output</summary>\r\n<!-- Add \"-v DEBUG\" when calling manim to generate more detailed logs -->\r\n\r\n```\r\nC:\\Users\\Daryl\\manim-dev\\manim>manim -p test.py\r\nManim Community v0.4.0\r\n\r\n1: Become\r\n2: BecomePoints\r\n3: BecomePointsScene\r\n4: BecomeStyle\r\n5: BecomeStyle2\r\n6: Image\r\n\r\nChoose number corresponding to desired scene/arguments.\r\n(Use comma separated list for multiple entries)\r\nChoice(s):  6\r\n[04/19/21 10:55:41] INFO                                                                        scene_file_writer.py:585\r\n                             File ready at C:\\Users\\Daryl\\manim-dev\\manim\\media\\images\\test\\Ima\r\n                             ge_ManimCE_v0.4.0.png\r\n\r\n                    INFO     Rendered Image                                                                 scene.py:199\r\n                             Played 0 animations\r\n                    INFO     Previewed File at:                                                           file_ops.py:98\r\n                             C:\\Users\\Daryl\\manim-dev\\manim\\media\\images\\test\\Image_ManimCE_v0.4.0.png\r\nTraceback (most recent call last):\r\n  File \"C:\\Users\\Daryl\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\manim-WZ_QM4hs-py3.9\\Scripts\\manim\", line 5, in <module>\r\n    main()\r\n  File \"C:\\Users\\Daryl\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\manim-WZ_QM4hs-py3.9\\lib\\site-packages\\click\\core.py\", line 829, in __call__\r\n    return self.main(*args, **kwargs)\r\n  File \"C:\\Users\\Daryl\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\manim-WZ_QM4hs-py3.9\\lib\\site-packages\\click\\core.py\", line 782, in main\r\n    rv = self.invoke(ctx)\r\n  File \"C:\\Users\\Daryl\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\manim-WZ_QM4hs-py3.9\\lib\\site-packages\\click\\core.py\", line 1259, in invoke\r\n    return _process_result(sub_ctx.command.invoke(sub_ctx))\r\n  File \"C:\\Users\\Daryl\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\manim-WZ_QM4hs-py3.9\\lib\\site-packages\\click\\core.py\", line 1066, in invoke\r\n    return ctx.invoke(self.callback, **ctx.params)\r\n  File \"C:\\Users\\Daryl\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\manim-WZ_QM4hs-py3.9\\lib\\site-packages\\click\\core.py\", line 610, in invoke\r\n    return callback(*args, **kwargs)\r\n  File \"C:\\Users\\Daryl\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\manim-WZ_QM4hs-py3.9\\lib\\site-packages\\click\\decorators.py\", line 21, in new_func\r\n    return f(get_current_context(), *args, **kwargs)\r\n  File \"C:\\Users\\Daryl\\manim-dev\\manim\\manim\\cli\\render\\commands.py\", line 166, in render\r\n    stable = req_info.json()[\"info\"][\"version\"]\r\nAttributeError: 'dict' object has no attribute 'json'\r\n```\r\n\r\n<!-- Insert screenshots here (only when absolutely necessary, we prefer copy/pasted output!) -->\r\n\r\n</details>\r\n\r\n\r\n## System specifications\r\n\r\n<details><summary>System Details</summary>\r\n\r\n- OS (with version, e.g Windows 10 v2004 or macOS 10.15 (Catalina)):\r\n- RAM:\r\n- Python version (`python/py/python3 --version`):\r\n- Installed modules (provide output from `pip list`):\r\n```\r\nPASTE HERE\r\n```\r\n</details>\r\n\r\n<details><summary>LaTeX details</summary>\r\n\r\n+ LaTeX distribution (e.g. TeX Live 2020):\r\n+ Installed LaTeX packages:\r\n<!-- output of `tlmgr list --only-installed` for TeX Live or a screenshot of the Packages page for MikTeX -->\r\n</details>\r\n\r\n<details><summary>FFMPEG</summary>\r\n\r\nOutput of `ffmpeg -version`:\r\n\r\n```\r\nPASTE HERE\r\n```\r\n</details>\r\n\r\n## Additional comments\r\n<!-- Add further context that you think might be relevant for this issue here. -->\r\n\n", "before_files": [{"content": "\"\"\"Manim's default subcommand, render.\n\nManim's render subcommand is accessed in the command-line interface via\n``manim``, but can be more explicitly accessed with ``manim render``. Here you\ncan specify options, and arguments for the render command.\n\n\"\"\"\nimport json\nimport sys\nfrom pathlib import Path\nfrom textwrap import dedent\n\nimport click\nimport cloup\nimport requests\n\nfrom ... import __version__, config, console, logger\nfrom ...constants import CONTEXT_SETTINGS, EPILOG\nfrom ...utils.exceptions import RerunSceneException\nfrom ...utils.module_ops import scene_classes_from_file\nfrom .ease_of_access_options import ease_of_access_options\nfrom .global_options import global_options\nfrom .output_options import output_options\nfrom .render_options import render_options\n\n\n@cloup.command(\n    context_settings=CONTEXT_SETTINGS,\n    epilog=EPILOG,\n)\n@click.argument(\"file\", type=Path, required=True)\n@click.argument(\"scene_names\", required=False, nargs=-1)\n@global_options\n@output_options\n@render_options\n@ease_of_access_options\n@click.pass_context\ndef render(\n    ctx,\n    **args,\n):\n    \"\"\"Render SCENE(S) from the input FILE.\n\n    FILE is the file path of the script.\n\n    SCENES is an optional list of scenes in the file.\n    \"\"\"\n    for scene in args[\"scene_names\"]:\n        if str(scene).startswith(\"-\"):\n            logger.warning(\n                dedent(\n                    \"\"\"\\\n                Manim Community has moved to Click for the CLI.\n\n                This means that options in the CLI are provided BEFORE the positional\n                arguments for your FILE and SCENE(s):\n                `manim render [OPTIONS] [FILE] [SCENES]...`\n\n                For example:\n                New way - `manim -p -ql file.py SceneName1 SceneName2 ...`\n                Old way - `manim file.py SceneName1 SceneName2 ... -p -ql`\n\n                To see the help page for the new available options, run:\n                `manim render -h`\n                \"\"\"\n                )\n            )\n            sys.exit()\n\n    if args[\"use_opengl_renderer\"]:\n        logger.warning(\n            \"--use_opengl_renderer is deprecated, please use --renderer=opengl instead!\"\n        )\n        renderer = \"opengl\"\n\n    if args[\"use_webgl_renderer\"]:\n        logger.warning(\n            \"--use_webgl_renderer is deprecated, please use --renderer=webgl instead!\"\n        )\n        renderer = \"webgl\"\n\n    if args[\"use_webgl_renderer\"] and args[\"use_opengl_renderer\"]:\n        logger.warning(\"You may select only one renderer!\")\n        sys.exit()\n\n    class ClickArgs:\n        def __init__(self, args):\n            for name in args:\n                setattr(self, name, args[name])\n\n        def _get_kwargs(self):\n            return list(self.__dict__.items())\n\n        def __eq__(self, other):\n            if not isinstance(other, ClickArgs):\n                return NotImplemented\n            return vars(self) == vars(other)\n\n        def __contains__(self, key):\n            return key in self.__dict__\n\n        def __repr__(self):\n            return str(self.__dict__)\n\n    click_args = ClickArgs(args)\n    if args[\"jupyter\"]:\n        return click_args\n\n    config.digest_args(click_args)\n    file = args[\"file\"]\n    if config.renderer == \"opengl\":\n        from manim.renderer.opengl_renderer import OpenGLRenderer\n\n        for SceneClass in scene_classes_from_file(file):\n            try:\n                renderer = OpenGLRenderer()\n                while True:\n                    scene_classes = scene_classes_from_file(file)\n                    SceneClass = scene_classes[0]\n                    scene = SceneClass(renderer)\n                    status = scene.render()\n                    if status:\n                        continue\n                    else:\n                        break\n            except Exception:\n                console.print_exception()\n    elif config.renderer == \"webgl\":\n        try:\n            from manim.grpc.impl import frame_server_impl\n\n            server = frame_server_impl.get(file)\n            server.start()\n            server.wait_for_termination()\n        except ModuleNotFoundError:\n            console.print(\n                \"Dependencies for the WebGL render are missing. Run \"\n                \"pip install manim[webgl_renderer] to install them.\"\n            )\n            console.print_exception()\n    else:\n        for SceneClass in scene_classes_from_file(file):\n            try:\n                scene = SceneClass()\n                scene.render()\n            except Exception:\n                console.print_exception()\n\n    if config.notify_outdated_version:\n        manim_info_url = \"https://pypi.org/pypi/manim/json\"\n        warn_prompt = \"Cannot check if latest release of manim is installed\"\n        req_info = {}\n\n        try:\n            req_info = requests.get(manim_info_url)\n            req_info.raise_for_status()\n        except requests.exceptions.HTTPError:\n            logger.debug(f\"HTTP Error: {warn_prompt}\")\n        except requests.exceptions.ConnectionError:\n            logger.debug(f\"Connection Error: {warn_prompt}\")\n        except requests.exceptions.Timeout:\n            logger.debug(f\"Timed Out: {warn_prompt}\")\n        except Exception:\n            logger.debug(f\"Something went wrong: {warn_prompt}\")\n\n        try:\n            stable = req_info.json()[\"info\"][\"version\"]\n\n            if stable != __version__:\n                console.print(\n                    f\"You are using manim version [red]v{__version__}[/red], but version [green]v{stable}[/green] is available.\"\n                )\n                console.print(\n                    \"You should consider upgrading via [yellow]pip install -U manim[/yellow]\"\n                )\n        except json.JSONDecodeError:\n            logger.debug(warn_prompt)\n            logger.debug(f\"Error decoding JSON from {manim_info_url}\")\n\n    return args\n", "path": "manim/cli/render/commands.py"}], "after_files": [{"content": "\"\"\"Manim's default subcommand, render.\n\nManim's render subcommand is accessed in the command-line interface via\n``manim``, but can be more explicitly accessed with ``manim render``. Here you\ncan specify options, and arguments for the render command.\n\n\"\"\"\nimport json\nimport sys\nfrom pathlib import Path\nfrom textwrap import dedent\n\nimport click\nimport cloup\nimport requests\n\nfrom ... import __version__, config, console, logger\nfrom ...constants import CONTEXT_SETTINGS, EPILOG\nfrom ...utils.exceptions import RerunSceneException\nfrom ...utils.module_ops import scene_classes_from_file\nfrom .ease_of_access_options import ease_of_access_options\nfrom .global_options import global_options\nfrom .output_options import output_options\nfrom .render_options import render_options\n\n\n@cloup.command(\n    context_settings=CONTEXT_SETTINGS,\n    epilog=EPILOG,\n)\n@click.argument(\"file\", type=Path, required=True)\n@click.argument(\"scene_names\", required=False, nargs=-1)\n@global_options\n@output_options\n@render_options\n@ease_of_access_options\n@click.pass_context\ndef render(\n    ctx,\n    **args,\n):\n    \"\"\"Render SCENE(S) from the input FILE.\n\n    FILE is the file path of the script.\n\n    SCENES is an optional list of scenes in the file.\n    \"\"\"\n    for scene in args[\"scene_names\"]:\n        if str(scene).startswith(\"-\"):\n            logger.warning(\n                dedent(\n                    \"\"\"\\\n                Manim Community has moved to Click for the CLI.\n\n                This means that options in the CLI are provided BEFORE the positional\n                arguments for your FILE and SCENE(s):\n                `manim render [OPTIONS] [FILE] [SCENES]...`\n\n                For example:\n                New way - `manim -p -ql file.py SceneName1 SceneName2 ...`\n                Old way - `manim file.py SceneName1 SceneName2 ... -p -ql`\n\n                To see the help page for the new available options, run:\n                `manim render -h`\n                \"\"\"\n                )\n            )\n            sys.exit()\n\n    if args[\"use_opengl_renderer\"]:\n        logger.warning(\n            \"--use_opengl_renderer is deprecated, please use --renderer=opengl instead!\"\n        )\n        renderer = \"opengl\"\n\n    if args[\"use_webgl_renderer\"]:\n        logger.warning(\n            \"--use_webgl_renderer is deprecated, please use --renderer=webgl instead!\"\n        )\n        renderer = \"webgl\"\n\n    if args[\"use_webgl_renderer\"] and args[\"use_opengl_renderer\"]:\n        logger.warning(\"You may select only one renderer!\")\n        sys.exit()\n\n    class ClickArgs:\n        def __init__(self, args):\n            for name in args:\n                setattr(self, name, args[name])\n\n        def _get_kwargs(self):\n            return list(self.__dict__.items())\n\n        def __eq__(self, other):\n            if not isinstance(other, ClickArgs):\n                return NotImplemented\n            return vars(self) == vars(other)\n\n        def __contains__(self, key):\n            return key in self.__dict__\n\n        def __repr__(self):\n            return str(self.__dict__)\n\n    click_args = ClickArgs(args)\n    if args[\"jupyter\"]:\n        return click_args\n\n    config.digest_args(click_args)\n    file = args[\"file\"]\n    if config.renderer == \"opengl\":\n        from manim.renderer.opengl_renderer import OpenGLRenderer\n\n        for SceneClass in scene_classes_from_file(file):\n            try:\n                renderer = OpenGLRenderer()\n                while True:\n                    scene_classes = scene_classes_from_file(file)\n                    SceneClass = scene_classes[0]\n                    scene = SceneClass(renderer)\n                    status = scene.render()\n                    if status:\n                        continue\n                    else:\n                        break\n            except Exception:\n                console.print_exception()\n    elif config.renderer == \"webgl\":\n        try:\n            from manim.grpc.impl import frame_server_impl\n\n            server = frame_server_impl.get(file)\n            server.start()\n            server.wait_for_termination()\n        except ModuleNotFoundError:\n            console.print(\n                \"Dependencies for the WebGL render are missing. Run \"\n                \"pip install manim[webgl_renderer] to install them.\"\n            )\n            console.print_exception()\n    else:\n        for SceneClass in scene_classes_from_file(file):\n            try:\n                scene = SceneClass()\n                scene.render()\n            except Exception:\n                console.print_exception()\n\n    if config.notify_outdated_version:\n        manim_info_url = \"https://pypi.org/pypi/manim/json\"\n        warn_prompt = \"Cannot check if latest release of manim is installed\"\n        req_info = {}\n\n        try:\n            req_info = requests.get(manim_info_url)\n            req_info.raise_for_status()\n\n            stable = req_info.json()[\"info\"][\"version\"]\n            if stable != __version__:\n                console.print(\n                    f\"You are using manim version [red]v{__version__}[/red], but version [green]v{stable}[/green] is available.\"\n                )\n                console.print(\n                    \"You should consider upgrading via [yellow]pip install -U manim[/yellow]\"\n                )\n        except requests.exceptions.HTTPError:\n            logger.debug(f\"HTTP Error: {warn_prompt}\")\n        except requests.exceptions.ConnectionError:\n            logger.debug(f\"Connection Error: {warn_prompt}\")\n        except requests.exceptions.Timeout:\n            logger.debug(f\"Timed Out: {warn_prompt}\")\n        except json.JSONDecodeError:\n            logger.debug(warn_prompt)\n            logger.debug(f\"Error decoding JSON from {manim_info_url}\")\n        except Exception:\n            logger.debug(f\"Something went wrong: {warn_prompt}\")\n\n    return args\n", "path": "manim/cli/render/commands.py"}]}