Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def find_library(name, vision_include):
conda_installed = library_found
else:
# Check if using Anaconda to produce wheels
conda = distutils.spawn.find_executable("conda")
conda = shutil.which("conda")
is_conda = conda is not None
print(f"Running build on conda: {is_conda}")
if is_conda:
Expand Down Expand Up @@ -259,8 +259,8 @@ def get_extensions():
image_macros += [("USE_PYTHON", None)]

# Locating libPNG
libpng = distutils.spawn.find_executable("libpng-config")
pngfix = distutils.spawn.find_executable("pngfix")
libpng = shutil.which("libpng-config")
pngfix = shutil.which("pngfix")
png_found = libpng is not None or pngfix is not None
print(f"PNG found: {png_found}")
if png_found:
Expand Down Expand Up @@ -340,7 +340,7 @@ def get_extensions():
)
)

ffmpeg_exe = distutils.spawn.find_executable("ffmpeg")
ffmpeg_exe = shutil.which("ffmpeg")
has_ffmpeg = ffmpeg_exe is not None
# FIXME: Building torchvision with ffmpeg on MacOS or with Python 3.9
# FIXME: causes crash. See the following GitHub issues for more details.
Expand All @@ -366,7 +366,7 @@ def get_extensions():
ffmpeg_include_dir = os.path.join(ffmpeg_root, "include")
ffmpeg_library_dir = os.path.join(ffmpeg_root, "lib")

gcc = os.environ.get("CC", distutils.spawn.find_executable("gcc"))
gcc = os.environ.get("CC", shutil.which("gcc"))
platform_tag = subprocess.run([gcc, "-print-multiarch"], stdout=subprocess.PIPE)
platform_tag = platform_tag.stdout.strip().decode("utf-8")

Expand Down