Make apps error on branch-4.7.1

add the development packages, build and get the development server running:
bult-in python version on system:2.7
customed python version:3.7.0
added in ~/.bashrc

export PYTHON_VER=python3.7

then

git clone https://github.com/cloudera/hue.git
cd hue
make apps

/hue/build/env/lib/python3.7/site-packages/_distutils_hack/init.py:19: UserWarning: Distutils was imported before Setuptools, but importing Setuptools also replaces the distutils module in sys.modules. This may lead to undesirable behaviors or errors. To avoid these issues, avoid using distutils directly, ensure that setuptools is installed in the traditional way (e.g. not an editable install), and/or make sure that setuptools is always imported before distutils.
"Distutils was imported before Setuptools, but importing Setuptools "
/data/opt/hue/hue/build/env/lib/python3.7/site-packages/_distutils_hack/init.py:33: UserWarning: Setuptools is replacing distutils.
warnings.warn(“Setuptools is replacing distutils.”)
Exception:
Traceback (most recent call last):
File “/data/opt/hue/hue/build/env/lib/python3.7/site-packages/pip/basecommand.py”, line 215, in main
status = self.run(options, args)
File “/data/opt/hue/hue/build/env/lib/python3.7/site-packages/pip/commands/install.py”, line 335, in run
wb.build(autobuilding=True)
File “/data/opt/hue/hue/build/env/lib/python3.7/site-packages/pip/wheel.py”, line 749, in build
self.requirement_set.prepare_files(self.finder)
File “/data/opt/hue/hue/build/env/lib/python3.7/site-packages/pip/req/req_set.py”, line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File “/data/opt/hue/hue/build/env/lib/python3.7/site-packages/pip/req/req_set.py”, line 634, in _prepare_file
abstract_dist.prep_for_dist()
File “/data/opt/hue/hue/build/env/lib/python3.7/site-packages/pip/req/req_set.py”, line 129, in prep_for_dist
self.req_to_install.run_egg_info()
File “/data/opt/hue/hue/build/env/lib/python3.7/site-packages/pip/req/req_install.py”, line 412, in run_egg_info
self.setup_py, self.name,
File “/data/opt/hue/hue/build/env/lib/python3.7/site-packages/pip/req/req_install.py”, line 387, in setup_py
import setuptools # noqa
File “/data/opt/hue/hue/build/env/lib/python3.7/site-packages/setuptools/init.py”, line 8, in
import _distutils_hack.override # noqa: F401
File “/data/opt/hue/hue/build/env/lib/python3.7/site-packages/_distutils_hack/override.py”, line 1, in
import(’_distutils_hack’).do_override()
File “/data/opt/hue/hue/build/env/lib/python3.7/site-packages/_distutils_hack/init.py”, line 77, in do_override
ensure_local_distutils()
File “/data/opt/hue/hue/build/env/lib/python3.7/site-packages/_distutils_hack/init.py”, line 64, in ensure_local_distutils
assert ‘_distutils’ in core.file, core.file
AssertionError: /root/.pyenv/versions/3.7.0/lib/python3.7/distutils/core.py

Try using a virtual environment to isolate the dependencies for the project. This can help to prevent conflicts with other packages that may be installed on your system.

when exec “make apps”, this action is making a virtual environment to isolate the dependencies for the project. but the built-in pyenv " /root/.pyenv/versions/3.7.0/lib/python3.7/distutils/core.py" went wrong