diff -r e9947323a7d7 Lib/distutils/command/build_ext.py --- a/Lib/distutils/command/build_ext.py Tue Aug 23 22:53:32 2016 +0900 +++ b/Lib/distutils/command/build_ext.py Wed Sep 14 18:07:12 2016 +0900 @@ -219,9 +219,7 @@ if sys.platform[:6] == 'cygwin' or sys.platform[:6] == 'atheos': if sys.executable.startswith(os.path.join(sys.exec_prefix, "bin")): # building third party extensions - self.library_dirs.append(os.path.join(sys.prefix, "lib", - "python" + get_python_version(), - "config")) + self.library_dirs.append(sysconfig.get_config_var('LIBPL')) else: # building python standard extensions self.library_dirs.append('.')