Skip to content
This repository was archived by the owner on Aug 15, 2025. It is now read-only.

Conversation

@seemethere
Copy link
Member

@seemethere seemethere commented Jan 28, 2020

distuils was absorbed into the stdlib as part of Python 3.8 which makes
the from setuptools import distutils invalid.

Instead of writing some try / except logic or logic based around Python
versions lets just make it so that you don't have to care at all and use
something that's built into the stdlib for everything.

NOTE: Doesn't work on anything python <= 2.6

CircleCI logs for reference

Jan 28 00:56:59 + echo 'Checking the OpenBLAS is not linked to'
Jan 28 00:56:59 Checking the OpenBLAS is not linked to
Jan 28 00:56:59 + all_dylibs=($(find "$(python -c 'from setuptools import distutils; print(distutils.sysconfig.get_python_lib())')"/torch -name '*.dylib'))
Jan 28 00:56:59 +++ python -c 'from setuptools import distutils; print(distutils.sysconfig.get_python_lib())'
Jan 28 00:56:59 Traceback (most recent call last):
Jan 28 00:56:59   File "<string>", line 1, in <module>
Jan 28 00:56:59 AttributeError: module 'distutils' has no attribute 'sysconfig'
Jan 28 00:56:59 ++ find /torch -name '*.dylib'
Jan 28 00:56:59 find: /torch: No such file or directory

Only really affects macOS

Will hopefully unblock pytorch/pytorch#31948

also includes some whitespace changes since my editor automatically removes trailing whitespace. (sorry, not sorry)

If you're worried about the whitespace changes, here's a diff where it doesn't show them: https://github.com/pytorch/builder/pull/398/files?utf8=%E2%9C%93&diff=split&w=1

Signed-off-by: Eli Uriegas eliuriegas@fb.com

distuils was absorbed into the stdlib as part of Python 3.8 which makes
the `from setuptools import distutils` invalid.

Instead of writing some try / except logic or logic based around Python
versions lets just make it so that you don't have to care at all and use
something that's built into the stdlib for everything.

NOTE: Doesn't work on anything python <= 2.6

Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
@seemethere seemethere requested a review from soumith January 28, 2020 01:31
@seemethere seemethere merged commit 981b645 into pytorch:master Jan 28, 2020
@seemethere seemethere deleted the fix_dist branch January 28, 2020 01:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant