You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG][pathfinder] Incorrect site-packages search order for venv created with --system-site-packages #1716
This summarizes a group chat discussion and additionally documents Cursor-based verification:
Problem
When cuda.pathfinder.load_nvidia_dynamic_lib searches for NVIDIA dynamic libraries in site-packages, it currently searches in the following order unconditionally:
User site-packages (site.getusersitepackages())
Site packages from site.getsitepackages() (which includes both virtual environment and system site-packages)
This ordering causes issues in a venv created with --system-site-packages: according to PEP 405 the correct search order should be (verified as explained below):
Virtual environment site-packages
User site-packages
System site-packages
Cursor-based verification
PEP 405 (Virtual Environments):
States that in a venv with --system-site-packages, system site directories are added after virtual environment site directories.
Notes that PEP 370 user-level site-packages are considered part of system site-packages for venv purposes.
PEP 370 (User Site-Packages):
States that user-site-packages are added before system site-packages (outside venv context).
Actual Python Behavior (verified by test):
In a venv with --system-site-packages, Python's sys.path order is:
Virtual environment site-packages
User site-packages
System site-packages
This confirms that the correct search order described above matches both PEP 405, PEP 370, and Python's actual behavior.
Activity
Fix site-packages search order for venv with --system-site-packages (f…
Fix site-packages search order for venv with --system-site-packages (f…