jupyterhub / jupyterhub-deploy-teaching

Reference deployment of JupyterHub and nbgrader on a single server
http://jupyterhub-deploy-teaching.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
246 stars 85 forks source link

Explicitly call pip instead of pip3 for an Anaconda environment. #76

Closed najibninaba closed 7 years ago

najibninaba commented 7 years ago

When I deploy the Ansible playbook (deploy.yml), I encountered the following pip installation errors:

TASK [python : user pip packages] ******************************************************************************************************************************************
failed: [192.168.122.45.xip.io] (item=brewer2mpl) => {"failed": true, "item": "brewer2mpl", "msg": "Unable to find any of pip3 to use.  pip needs to be installed."}
failed: [192.168.122.45.xip.io] (item=ggplot) => {"failed": true, "item": "ggplot", "msg": "Unable to find any of pip3 to use.  pip needs to be installed."}
failed: [192.168.122.45.xip.io] (item=ipythonblocks) => {"failed": true, "item": "ipythonblocks", "msg": "Unable to find any of pip3 to use.  pip needs to be installed."}
failed: [192.168.122.45.xip.io] (item=plotly) => {"failed": true, "item": "plotly", "msg": "Unable to find any of pip3 to use.  pip needs to be installed."}`

As Anaconda/Miniconda is used as the Python environment, the correct pip3 executable is still named as pip (under /opt/conda/bin/pip). This fix aims to correct this issue.

After specifying the executable option, I get the correct pip installation behaviour:

TASK [python : user pip packages] ******************************************************************************************************************************************
ok: [192.168.122.45.xip.io] => (item=brewer2mpl)
ok: [192.168.122.45.xip.io] => (item=ggplot)
ok: [192.168.122.45.xip.io] => (item=ipythonblocks)
ok: [192.168.122.45.xip.io] => (item=plotly)

Best Regards, -najib