Skip to content

Commit

Permalink
Fix imgui_bundle patch directory, add numpy import
Browse files Browse the repository at this point in the history
  • Loading branch information
Aman-Anas committed Jan 2, 2024
1 parent 08412a5 commit 919d99e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions my_game/bgimgui/__init__.py
Original file line number Diff line number Diff line change
@@ -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."
Expand Down

0 comments on commit 919d99e

Please sign in to comment.