From 0ee77457c8294c0706f6fda3de0a1a64097493b4 Mon Sep 17 00:00:00 2001 From: Kaushik Kulkarni Date: Thu, 11 Aug 2022 23:54:39 -0500 Subject: [PATCH 1/2] use importlib to get the pycuda location pkg_resources is returning incorrect location for pip==22.2 --- pycuda/compiler.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pycuda/compiler.py b/pycuda/compiler.py index b84a0716..369b6375 100644 --- a/pycuda/compiler.py +++ b/pycuda/compiler.py @@ -206,9 +206,12 @@ def _get_per_user_string(): def _find_pycuda_include_path(): - from pkg_resources import Requirement, resource_filename + import importlib.util + import os - return resource_filename(Requirement.parse("pycuda"), "pycuda/cuda") + return os.path.abspath( + os.path.join(importlib.util.find_spec("pycuda").origin, + os.path.join(os.path.pardir, "cuda"))) DEFAULT_NVCC_FLAGS = [ -- GitLab From 92bf38a10b38337ba2516c3ab6ff630062ddec06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Kl=C3=B6ckner?= Date: Tue, 16 Aug 2022 19:17:05 +0000 Subject: [PATCH 2/2] Apply 1 suggestion(s) to 1 file(s) --- pycuda/compiler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pycuda/compiler.py b/pycuda/compiler.py index 369b6375..96aa1b19 100644 --- a/pycuda/compiler.py +++ b/pycuda/compiler.py @@ -211,7 +211,7 @@ def _find_pycuda_include_path(): return os.path.abspath( os.path.join(importlib.util.find_spec("pycuda").origin, - os.path.join(os.path.pardir, "cuda"))) + os.path.pardir, "cuda")) DEFAULT_NVCC_FLAGS = [ -- GitLab