Failed to find required executable virtualenv in paths

780 views
Skip to first unread message

Emma

unread,
Sep 1, 2020, 8:29:07 AM9/1/20
to OpenWISP
I am getting the below error message in ansible-playook:

ansible-playbook

TASK [openwisp.openwisp2 : Remove jsonfield2] *******************************************************************************************************************************************
FAILED - RETRYING: Remove jsonfield2 (2 retries left).
FAILED - RETRYING: Remove jsonfield2 (1 retries left).
fatal: [myhostname]: FAILED! => {"attempts": 2, "changed": false, "msg": "Failed to find required executable virtualenv in paths: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"}

RUNNING HANDLER [Stouts.postfix : postfix restart] **************************************************************************************************************************************

RUNNING HANDLER [openwisp.openwisp2 : start redis] **************************************************************************************************************************************

PLAY RECAP ******************************************************************************************************************************************************************************
[myhostname]           : ok=21   changed=5    unreachable=0    failed=1    skipped=25   rescued=0    ignored=1 


in log file(/var/log/messages)
Sep  1 13:22:36 myhostname ansible-pip: Invoked with virtualenv=/opt/openwisp2/env virtualenv_site_packages=True virtualenv_command=virtualenv chdir=None requirements=None name=['jsonfield2'] virtualenv_python=python3 editable=False umask=None executable=None extra_args=None state=absent version=None
Sep  1 13:22:51 myhostname ansible-pip: message repeated 2 times: [ Invoked with virtualenv=/opt/openwisp2/env virtualenv_site_packages=True virtualenv_command=virtualenv chdir=None requirements=None name=['jsonfield2'] virtualenv_python=python3 editable=False umask=None executable=None extra_args=None state=absent version=None]

myhostname:/etc# cat /etc/issue
Ubuntu 18.04.5 LTS \n \l

myhostname:/etc# cat /etc/issue.net 
Ubuntu 18.04.5 LTS
myhostname:/etc# 

Federico Capoano

unread,
Sep 1, 2020, 1:51:46 PM9/1/20
to OpenWISP
I found this being mentioned in an issue on ansible from 2015: https://github.com/ansible/ansible-modules-core/issues/688

What ansible version are you using?

Try updating your ansible version to have a recent version (I have 2.9.7 now, the README says 2.5 is the minimum, but it may need to be updated).

Then you should try to run the playbook again. If that fixes it, let me know and I'll update the min version advised.

If it doesn't you can try installing python virtualenv manually on the system.

For some reason ansible is not installing the python virtual environment package correctly, which is a requirement, I've seen this error on other occasions, I thought it was fixed.

I hope this helps.

Federico

Emma

unread,
Sep 3, 2020, 1:42:53 AM9/3/20
to OpenWISP
Hi Federico,

It works after I installed the python virtualenv manually on the system.  The ansible version is 2.9.13.

Regards,

Emma

Oliver Fletcher

unread,
May 18, 2021, 6:29:54 AM5/18/21
to OpenWISP

I had the same issue on Ubuntu and the solution was to add python-virtualenv to the pkg list

    - name: install webserver components
      apt:
        pkg:
        - apache2
        - libapache2-mod-wsgi-py3
        - python3-pip
        - python-virtualenv
        state: present
        update_cache: yes


Reply all
Reply to author
Forward
0 new messages