From a9491d17ad572b9c65286a965911d89e82e6ca82 Mon Sep 17 00:00:00 2001 From: Jared Van Bortel Date: Wed, 28 Aug 2024 12:14:24 -0400 Subject: [PATCH 1/3] python: warn if Microsoft Visual C++ runtime libs are not found Signed-off-by: Jared Van Bortel --- gpt4all-bindings/python/gpt4all/_pyllmodel.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/gpt4all-bindings/python/gpt4all/_pyllmodel.py b/gpt4all-bindings/python/gpt4all/_pyllmodel.py index d623b528fd54..208d834c580c 100644 --- a/gpt4all-bindings/python/gpt4all/_pyllmodel.py +++ b/gpt4all-bindings/python/gpt4all/_pyllmodel.py @@ -37,7 +37,20 @@ raise RuntimeError(textwrap.dedent("""\ Running GPT4All under Rosetta is not supported due to CPU feature requirements. Please install GPT4All in an environment that uses a native ARM64 Python interpreter. - """)) + """).strip()) + +# Check for C++ runtime libraries +if platform.system() == "Windows": + try: + ctypes.CDLL("msvcp140.dll") + ctypes.CDLL("vcruntime140.dll") + ctypes.CDLL("vcruntime140_1.dll") + except OSError as e: + print(textwrap.dedent(f"""\ + {e!r} + The Microsoft Visual C++ runtime libraries were not found. Please install them from + https://aka.ms/vs/17/release/vc_redist.x64.exe + """), file=sys.stderr) def _load_cuda(rtver: str, blasver: str) -> None: From 33997e3ac5c86152e3aa1093a672adcc6785265f Mon Sep 17 00:00:00 2001 From: Jared Van Bortel Date: Wed, 28 Aug 2024 12:38:22 -0400 Subject: [PATCH 2/3] py(changelog): add this PR Signed-off-by: Jared Van Bortel --- gpt4all-bindings/python/CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gpt4all-bindings/python/CHANGELOG.md b/gpt4all-bindings/python/CHANGELOG.md index 6934649899c6..2bc195ec0ea4 100644 --- a/gpt4all-bindings/python/CHANGELOG.md +++ b/gpt4all-bindings/python/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). +## [Unreleased] + +### Added +- Warn on Windows if the Microsoft Visual C++ runtime libraries are not found ([#2920](https://github.com/nomic-ai/gpt4all/pull/2920)) + ## [2.8.2] - 2024-08-14 ### Fixed @@ -56,6 +61,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). - Restore leading space removal logic that was incorrectly removed in [#2694](https://github.com/nomic-ai/gpt4all/pull/2694) - CUDA: Cherry-pick llama.cpp DMMV cols requirement fix that caused a crash with long conversations since [#2694](https://github.com/nomic-ai/gpt4all/pull/2694) +[Unreleased]: https://github.com/nomic-ai/gpt4all/compare/python-v2.8.2...HEAD [2.8.2]: https://github.com/nomic-ai/gpt4all/compare/python-v2.8.1...python-v2.8.2 [2.8.1]: https://github.com/nomic-ai/gpt4all/compare/python-v2.8.0...python-v2.8.1 [2.8.0]: https://github.com/nomic-ai/gpt4all/compare/python-v2.7.0...python-v2.8.0 From 56d76fbe4189ebd0e06ddea1676eb641794df777 Mon Sep 17 00:00:00 2001 From: Jared Van Bortel Date: Fri, 30 Aug 2024 12:45:21 -0400 Subject: [PATCH 3/3] py: bump version Signed-off-by: Jared Van Bortel --- gpt4all-bindings/python/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gpt4all-bindings/python/setup.py b/gpt4all-bindings/python/setup.py index 75476875bbd9..e96f58405fe3 100644 --- a/gpt4all-bindings/python/setup.py +++ b/gpt4all-bindings/python/setup.py @@ -68,7 +68,7 @@ def get_long_description(): setup( name=package_name, - version="2.8.2", + version="2.8.3.dev0", description="Python bindings for GPT4All", long_description=get_long_description(), long_description_content_type="text/markdown",