diff --git a/ci/scripts/python_wheel_windows_build.bat b/ci/scripts/python_wheel_windows_build.bat index 1f1d5dca721d9..b13aabb316f25 100644 --- a/ci/scripts/python_wheel_windows_build.bat +++ b/ci/scripts/python_wheel_windows_build.bat @@ -121,7 +121,5 @@ set ARROW_HOME=C:\arrow-dist set CMAKE_PREFIX_PATH=C:\arrow-dist pushd C:\arrow\python -@REM bundle the msvc runtime -cp "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\14.28.29325\x64\Microsoft.VC142.CRT\msvcp140.dll" pyarrow\ python setup.py bdist_wheel || exit /B 1 popd diff --git a/python/pyarrow/__init__.py b/python/pyarrow/__init__.py index d00a731324c92..5b03ae5c2305d 100644 --- a/python/pyarrow/__init__.py +++ b/python/pyarrow/__init__.py @@ -62,7 +62,24 @@ def parse_git(root, **kwargs): # to workaround Cython bug in https://github.com/cython/cython/issues/3603 _gc_enabled = _gc.isenabled() _gc.disable() -import pyarrow.lib as _lib + +try: + import pyarrow.lib as _lib +except ImportError: + if _os.name == 'nt': + # Give a clearer error message if the import failed because of missing + # the C++ runtime for MSVC (see GH-44855). + import ctypes + try: + ctypes.CDLL('msvcp140.dll') + except OSError: + raise ImportError( + "PyArrow import failure, presumably because the Microsoft Visual C++ " + "Redistributable is not installed. You can download it from " + "https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist") + # Other cases: re-raise original error + raise + if _gc_enabled: _gc.enable() diff --git a/python/setup.py b/python/setup.py index 60b9a696d9785..3ae1c5b8d4718 100755 --- a/python/setup.py +++ b/python/setup.py @@ -129,8 +129,6 @@ def run(self): ('extra-cmake-args=', None, 'extra arguments for CMake'), ('build-type=', None, 'build type (debug or release), default release'), - ('boost-namespace=', None, - 'namespace of boost (default: boost)'), ('with-cuda', None, 'build the Cuda extension'), ('with-flight', None, 'build the Flight extension'), ('with-substrait', None, 'build the Substrait extension'), @@ -144,14 +142,10 @@ def run(self): ('with-gcs', None, 'build the Google Cloud Storage (GCS) extension'), ('with-s3', None, 'build the Amazon S3 extension'), - ('with-static-parquet', None, 'link parquet statically'), - ('with-static-boost', None, 'link boost statically'), ('with-orc', None, 'build the ORC extension'), ('with-gandiva', None, 'build the Gandiva extension'), ('generate-coverage', None, 'enable Cython code coverage'), - ('bundle-boost', None, - 'bundle the (shared) Boost libraries'), ('bundle-cython-cpp', None, 'bundle generated Cython C++ code ' '(used for code coverage)'),