From 919d99e0aed564a3041de7f693ea26afebf5d4e5 Mon Sep 17 00:00:00 2001 From: Aman Anas Date: Tue, 2 Jan 2024 10:12:49 -0500 Subject: [PATCH] Fix imgui_bundle patch directory, add numpy import --- my_game/bgimgui/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/my_game/bgimgui/__init__.py b/my_game/bgimgui/__init__.py index 462fd76..9f1ce86 100644 --- a/my_game/bgimgui/__init__.py +++ b/my_game/bgimgui/__init__.py @@ -1,10 +1,13 @@ -import site +import os +import sys import pathlib +import numpy as np # What follows is an incredibly cursed workaround for a bug when importing imgui_bundle # via the embedded player multiple times. -user_package_path = site.getusersitepackages() +user_package_path = os.path.join(sys.prefix, 'lib', 'site-packages') + imgui_path = pathlib.Path(f"{user_package_path}/imgui_bundle/__init__.py") if not imgui_path.exists(): msg = "imgui_bundle is not installed. Please refer to the bgimgui config instructions."