Juniper Installation Failing

Hello,

Trying to install Juniper in Azure cloud (Ubuntu 16.04 LTS) using the Native installation method described in via Ansible https://openedx.atlassian.net/wiki/spaces/OpenOPS/pages/146440579/Native+Open+edX+platform+Ubuntu+16.04+64+bit+Installation

It fails with below error.

TASK [edxapp : Create the virtualenv to install the Python sandbox requirements] ***
fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["virtualenv", "/edx/app/edxapp/venvs/edxapp-sandbox", "-p", "python3.5"], "delta": "0:00:00.060184", "end": "2020-08-31 15:34:35.715016", "msg": "non-zero return code", "rc": 1, "start": "2020-08-31 15:34:35.654832", "stderr": "Traceback (most recent call last):\n  File \"/usr/local/lib/python2.7/dist-packages/virtualenv.py\", line 24, in <module>\n    import distutils.spawn\n  File \"<frozen importlib._bootstrap>\", line 969, in _find_and_load\n  File \"<frozen importlib._bootstrap>\", line 958, in _find_and_load_unlocked\n  File \"<frozen importlib._bootstrap>\", line 666, in _load_unlocked\n  File \"<frozen importlib._bootstrap>\", line 577, in module_from_spec\n  File \"/edx/app/edxapp/venvs/edxapp/lib/python3.5/site-packages/_distutils_hack/__init__.py\", line 82, in create_module\n    return importlib.import_module('._distutils', 'setuptools')\n  File \"/edx/app/edxapp/venvs/edxapp/lib/python3.5/importlib/__init__.py\", line 126, in import_module\n    return _bootstrap._gcd_import(name[level:], package, level)\n  File \"<frozen importlib._bootstrap>\", line 981, in _gcd_import\n  File \"<frozen importlib._bootstrap>\", line 931, in _sanity_check\nSystemError: Parent module 'setuptools' not loaded, cannot perform relative import", "stderr_lines": ["Traceback (most recent call last):", "  File \"/usr/local/lib/python2.7/dist-packages/virtualenv.py\", line 24, in <module>", "    import distutils.spawn", "  File \"<frozen importlib._bootstrap>\", line 969, in _find_and_load", "  File \"<frozen importlib._bootstrap>\", line 958, in _find_and_load_unlocked", "  File \"<frozen importlib._bootstrap>\", line 666, in _load_unlocked", "  File \"<frozen importlib._bootstrap>\", line 577, in module_from_spec", "  File \"/edx/app/edxapp/venvs/edxapp/lib/python3.5/site-packages/_distutils_hack/__init__.py\", line 82, in create_module", "    return importlib.import_module('._distutils', 'setuptools')", "  File \"/edx/app/edxapp/venvs/edxapp/lib/python3.5/importlib/__init__.py\", line 126, in import_module", "    return _bootstrap._gcd_import(name[level:], package, level)", "  File \"<frozen importlib._bootstrap>\", line 981, in _gcd_import", "  File \"<frozen importlib._bootstrap>\", line 931, in _sanity_check", "SystemError: Parent module 'setuptools' not loaded, cannot perform relative import"], "stdout": "Running virtualenv with interpreter /edx/app/edxapp/venvs/edxapp/bin/python3.5", "stdout_lines": ["Running virtualenv with interpreter /edx/app/edxapp/venvs/edxapp/bin/python3.5"]}


============================================================
Ansible failed!
------------------------------------------------------------
 
Decoded error:
== cmd ===========================
['virtualenv', '/edx/app/edxapp/venvs/edxapp-sandbox', '-p', 'python3.5']
== msg ===========================
non-zero return code
== stderr ===========================
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 24, in <module>
    import distutils.spawn
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 666, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 577, in module_from_spec
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.5/site-packages/_distutils_hack/__init__.py", line 82, in create_module
    return importlib.import_module('._distutils', 'setuptools')
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 981, in _gcd_import
  File "<frozen importlib._bootstrap>", line 931, in _sanity_check
SystemError: Parent module 'setuptools' not loaded, cannot perform relative import
== stdout ===========================
Running virtualenv with interpreter /edx/app/edxapp/venvs/edxapp/bin/python3.5
 
============================================================
Installation failed!

    Your environment:
        OPENEDX_RELEASE=open-release/juniper.3 

Any pointer to resolve this issue will be helpful.

Thanks.

@Gaurav_Vijayvergia, this appears to be a setuptools issue as per https://github.com/pypa/setuptools/issues/2352 and has to be fixed there or in the Open edX repositories by pinning it to a version < 50.

We’re testing this pull request as a fix: https://github.com/edx/configuration/pull/5978

Thanks Ned & Guruprasad for the response,

yes even I can across the same link yesterday night after posting on the forum here. Trying to figure out the downgrading of setuptools version. Noticed that to bootstrap the setup, a dependency of v44 is specified in ansible shell script. Couldn’t understand yet , why the latest version of setuptools is being fetched.

Hi @nedbat

Looking at the recent commits and the merge request, it seems that fix is still being tested on master version. Can i know, if this fix will be available to “open-release/juniper.3” version ? Sorry, not sure on edX release process hence confirming before I can decide whether to directly use master version.

Thanks

We will be making fixes on the Juniper master branch, once we have it all straightened out.

I’ve pushed a fix to open-release/juniper.master

Thanks @nedbat. It is working now.