# accelerate mode and custom python interpreter (virtualenv)

**URL:** <https://forum.ansible.com/t/accelerate-mode-and-custom-python-interpreter-virtualenv/19162>\
**Category:** Ansible Project\
**Created:** [September 2, 2015, 7:33am UTC](https://forum.ansible.com/t/accelerate-mode-and-custom-python-interpreter-virtualenv/19162 "2015-09-02T07:33:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![knacktus](https://avatars.discourse-cdn.com/v4/letter/k/a5b964/32.png) [@knacktus](https://forum.ansible.com/u/knacktus)\
**Post date:** [September 2, 2015, 7:33am UTC](https://forum.ansible.com/t/accelerate-mode-and-custom-python-interpreter-virtualenv/19162/1 "2015-09-02T07:33:05Z")

</div>

Hi guys,

unfortunately I’m on REHL6 without the option to install python packages for the standard python installation. Thus I’m using Ansible from an virtualenv on the managing node. That works fine, except that now I’m running into performance issues.

The virtualenv sits on a nfs share which is mounted to all nodes. Thus it is available on all nodes.

python-keyczar is installed in the virtualenv and seems to work. At least the following command runs from within the virtualenv

`keyczart create --location=~/temp --purpose=crypt`

Now I’ve created a wrapper script for the custom python interpreter (`/home/test/PythonVirtualEnv/pyenv`  
`)`:

`  
#!/bin/tcsh

source /home/ft2vwaa/PythonVirtualEnv/AnsibleEnv2/bin/activate.csh

python $argv[1]

`

and I can use it as custom interpreter, e.g.:

`

- hosts: logstash  
name: Source virtual env  
remote\_user: “{{ test\_remote\_user }}”  
vars:  
ansible\_python\_interpreter: /home/test/PythonVirtualEnv/pyenv  
tasks:
- name: check  
shell: echo $VIRTUAL\_ENV  
register: out
- debug: var=out.stdout\_lines  
`

This prints out the virtualenv as expected. So it is actually loaded.

But adding the accelerate mode directive results in an error.

`

- hosts: logstash  
name: Source virtual env  
remote\_user: “{{ ipf\_remote\_user }}”  
accelerate: true  
vars:  
ansible\_python\_interpreter: /home/ft2vwaa/PythonVirtualEnv/pyenv  
tasks:
- name: check  
shell: echo $VIRTUAL\_ENV  
register: out
- debug: var=out.stdout\_lines  
`

`

GATHERING FACTS \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
fatal: [server\_01] =\> Failed to launch the accelerated daemon on `server_01` (reason: keyczar is not installed (on the remote side))  
fatal: [server\_02] =\> Failed to launch the accelerated daemon on `server_02 `(reason: keyczar is not installed (on the remote side))

`

Any ideas or suggestions are highly welcome.

Cheers,

Jan

---

<div class="post-metadata">

**Author:** ![Toshio\_Kuratomi](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@Toshio\_Kuratomi](https://forum.ansible.com/u/Toshio_Kuratomi)\
**Post date:** [September 2, 2015, 8:13pm UTC](https://forum.ansible.com/t/accelerate-mode-and-custom-python-interpreter-virtualenv/19162/2 "2015-09-02T20:13:41Z")

</div>

I haven't looked at the code yet to see if there's something about  
accelerate that may interfere with ansible\_python\_interpreter but I  
have a feeling that you might not get any speedup even if you get it  
working. accelerate was written before openssh's controlpersist was  
widespread. Now that even RHEL6 has a controlpersist capable openssh,  
there's not much reason to use it for most platforms.

-Toshio
