diff --git a/src/mlpack/bindings/python/copy_artifacts.py b/src/mlpack/bindings/python/copy_artifacts.py index ab62a403c5..969be65451 100644 --- a/src/mlpack/bindings/python/copy_artifacts.py +++ b/src/mlpack/bindings/python/copy_artifacts.py @@ -6,18 +6,14 @@ # terms of the 3-clause BSD license. You should have received a copy of the # 3-clause BSD license along with mlpack. If not, see # http://www.opensource.org/licenses/BSD-3-Clause for more information. -import sys import sysconfig import shutil import os +import glob -directory = 'build/lib.' + \ - sysconfig.get_platform() + \ - '-' + \ - str(sys.version_info[0]) + \ - '.' + \ - str(sys.version_info[1]) + \ - '/mlpack/' +# Match any lib.$platform*/mlpack/ directory. +directory = glob.glob('build/lib.' + sysconfig.get_platform() + '*/mlpack/')[0] +directory = directory.replace('\\', '/') # Now copy all the files from the directory to the desired location. for f in os.listdir(directory):