Question

I'm trying to install EdX following https://github.com/edx/configuration/wiki/edX-Ubuntu-12.04-64-bit-Installation.

Even do I just need to run the sudo ansible-playbook -c local ./edx_sandbox.yml -i "localhost," and wait.

It always failed on the following ansible task:

# Install the python modules into {{ edxapp_venv_dir }}
- name : install python base-requirements
  # Need to use shell rather than pip so that we can maintain the context of our current working directory; some
  # requirements are pathed relative to the edx-platform repo. Using the pip from inside the virtual environment implicitly
  # installs everything into that virtual environment.
  shell: >
    {{ edxapp_venv_dir }}/bin/pip install -i {{ COMMON_PYPI_MIRROR_URL }} --exists-action w --use-mirrors -r {{ base_requirements_file }}
    chdir={{ edxapp_code_dir }}
  environment: "{{ edxapp_environment }}"
  sudo_user: "{{ edxapp_user }}"
  notify:
    - "restart edxapp"
    - "restart edxapp_workers"
  when: not inst.stat.exists or new.stat.md5 != inst.stat.md5

So why is failing and the other pip installations are working fine, can I get the same goal using a task modification?

This is the error showing:

***Traceback (most recent call last):
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/pip/basecommand.py", line 122, in main status = self.run(options, args)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/pip/commands/install.py", line 278, in run requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/pip/req.py", line 1197, in prepare_files do_download,
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/pip/req.py", line 1375, in unpack_url self.session,
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/pip/download.py", line 546, in unpack_http_url resp = session.get(target_url, stream=True)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/pip/_vendor/requests/sessions.py", line 395, in get return self.request('GET', url, **kwargs)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/pip/download.py", line 237, in request     return super(PipSession, self).request(method, url, *args, **kwargs)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/pip/_vendor/requests/sessions.py", line 383, in request resp = self.send(prep, **send_kwargs)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/pip/_vendor/requests/sessions.py", line 486, in send r = adapter.send(request, **kwargs)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/pip/_vendor/requests/adapters.py", line 387, in send raise Timeout(e)
Timeout: (<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x295a6d0>, 'Connection to pypi.python.org timed out. (connect timeout=15)')***
Was it helpful?

Solution

The problem here is the value of the mirror and that it can't find it:

{{ COMMON_PYPI_MIRROR_URL }}

That value is set here in the edx-west/roles/common/defaults/main.yml file:

COMMON_PYPI_MIRROR_URL: 'https://pypi.python.org/simple'

I would try changing it to some other mirror specifically and initially using http (as there may be a problem with https from the logs):

http://b.pypi.python.org/simple or
http://c.pypi.python.org/simple or
http://d.pypi.python.org/simple

Also you can try omitting the option in your playbook:

-i {{ COMMON_PYPI_MIRROR_URL }}

as per the documentation where they mention that the --use-mirrors or setting export PIP_USE_MIRRORS=true on the shell should be enough.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top