From f0d2377b45b1a8313e725821494db65581867ce7 Mon Sep 17 00:00:00 2001 From: cozy-chestnut <38964314+cozy-chestnut@users.noreply.github.com> Date: Tue, 26 Nov 2019 01:25:09 -0800 Subject: [PATCH] Update setup.py to Python 3.4+ Compatible According to the Python documentation, the imp library is "deprecated since version 3.4: The imp package is pending deprecation in favor of importlib." That's why I replace the imp call with importlib to make it compatible with Python higher than 3.4. I'm proposing this, because I went into issue building the darkflow with Python 3.5.1 or higher. Hope this would help others who encountered the same issue. =] Further info about imp, refer to the Python Documentation below: https://docs.python.org/3/library/imp.html --- setup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index d3d255e39..10c985035 100644 --- a/setup.py +++ b/setup.py @@ -3,9 +3,9 @@ from Cython.Build import cythonize import numpy import os -import imp +from importlib.machinery import SourceFileLoader -VERSION = imp.load_source('version', os.path.join('.', 'darkflow', 'version.py')) +VERSION = SourceFileLoader('version', './darkflow/version.py').load_module() VERSION = VERSION.__version__ if os.name =='nt' : @@ -71,4 +71,4 @@ packages = find_packages(), scripts = ['flow'], ext_modules = cythonize(ext_modules) -) \ No newline at end of file +)