From ac63fa1ebbabd70222df21ed4c3f31d1eefc19f4 Mon Sep 17 00:00:00 2001 From: Logan Pugh Date: Tue, 30 Jul 2024 18:11:42 -0500 Subject: [PATCH 1/2] Update for Pro 3.3.x and Python 3.11 --- archook/archook.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/archook/archook.py b/archook/archook.py index 46b7510..d64a9c3 100644 --- a/archook/archook.py +++ b/archook/archook.py @@ -109,17 +109,18 @@ def get_pro_paths(): PRO_WIN_PATHS = inspect.cleandoc( r""" {C} - {C}\Library\mingw-w64 - {C}\Library\usr\bin {C}\Library\bin {C}\Scripts - {P}\Python\Scripts {P}\bin + {P}\bin\Python + {P}\bin\Python\Library\bin + {P}\bin\Python\Scripts + {P}\bin\Python\condabin """.format(C=C, P=P)) PRO_SYSPATHS = inspect.cleandoc( r""" {C} - {C}\python36.zip + {C}\python311.zip {C}\DLLs {C}\lib {C}\lib\site-packages @@ -147,10 +148,9 @@ def get_arcpy(pro=False): # pro_conda_dir = locate_pro_conda() winpaths, syspaths = get_pro_paths() - # update Windows PATH - wp = os.environ["PATH"].split(";") # save incoming path - [wp.insert(0, x) for x in winpaths] # prepend our new syspath - os.environ["PATH"] = ";".join(wp) # write back to environment + # Explicitly add directories to DLL search path. Refer to https://docs.python.org/3/library/os.html#os.add_dll_directory + for wp in winpaths: + os.add_dll_directory(wp) # update sys.path [sys.path.insert(0, x) for x in syspaths] From b3bdffc0d43afc08631ba228fd4397e45d17a45e Mon Sep 17 00:00:00 2001 From: Logan Pugh Date: Tue, 30 Jul 2024 19:14:02 -0500 Subject: [PATCH 2/2] Remove additional unnecessary paths --- archook/archook.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/archook/archook.py b/archook/archook.py index d64a9c3..715d449 100644 --- a/archook/archook.py +++ b/archook/archook.py @@ -110,12 +110,7 @@ def get_pro_paths(): r""" {C} {C}\Library\bin - {C}\Scripts {P}\bin - {P}\bin\Python - {P}\bin\Python\Library\bin - {P}\bin\Python\Scripts - {P}\bin\Python\condabin """.format(C=C, P=P)) PRO_SYSPATHS = inspect.cleandoc( r"""