✈ Pre-Flight checks
🐞 Describe the bug
testing todays built with the C# Loader,
Running a test CPython script, it seems the loader can't find the pyrevitlib assemblies.
I had to manually inject the existing path into sys.path then import pyrevit.
⌨ Error/Debug Message
CPython Traceback:
No module named 'pyrevit'
♻️ To Reproduce
No response
⏲️ Expected behavior
the way to solve it:
try:
import pyrevit
except ImportError:
# 1. Find the path that contains the CPython Engine
engine_path = next((p for p in sys.path if "pyRevit-Master" in p and "cengines" in p), None)
if engine_path:
# 2. Derive the root 'pyrevitlib' folder
root_path = engine_path.split(r"\bin")[0]
lib_path = os.path.join(root_path, "pyrevitlib")
site_path = os.path.join(root_path, "site-packages")
# 3. Inject into sys.path
if os.path.exists(lib_path) and lib_path not in sys.path:
sys.path.append(lib_path)
if os.path.exists(site_path) and site_path not in sys.path:
sys.path.append(site_path)
🖥️ Hardware and Software Setup (please complete the following information)
5.3.1.26008+2214-wip:3123:2025.4.40
Additional context
No response
✈ Pre-Flight checks
🐞 Describe the bug
testing todays built with the C# Loader,
Running a test CPython script, it seems the loader can't find the pyrevitlib assemblies.
I had to manually inject the existing path into sys.path then import pyrevit.
⌨ Error/Debug Message
CPython Traceback: No module named 'pyrevit'♻️ To Reproduce
No response
⏲️ Expected behavior
the way to solve it:
🖥️ Hardware and Software Setup (please complete the following information)
Additional context
No response