# How to handle local pipenv?

**URL:** <https://forum.ansible.com/t/how-to-handle-local-pipenv/39550>\
**Category:** Get Help\
**Tags:** pip, proxmox, ee\
**Created:** [January 10, 2025, 8:24pm UTC](https://forum.ansible.com/t/how-to-handle-local-pipenv/39550 "2025-01-10T20:24:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![DengelFred](https://avatars.discourse-cdn.com/v4/letter/d/87869e/32.png) [@DengelFred](https://forum.ansible.com/u/DengelFred)\
**Post date:** [January 10, 2025, 8:24pm UTC](https://forum.ansible.com/t/how-to-handle-local-pipenv/39550/1 "2025-01-10T20:24:36Z")

</div>

Hello,

I use a separate pipenv for executing ansible:  
`pipenv run ansible-playbook -v tests/test_pip.yml`

Now I have a playbook, that requires proxmoxer installed in the local pipenv:

```auto
 name: test pipenv handling
  hosts: localhost
  tasks:
    - name: install proxmoxer
      delegate_to: localhost
      ansible.builtin.pip:
        executable: pipenv
        name: proxmoxer

```

The task executes successfully, but I cannot find the proxmoxer package in the local Pipefile? The proxmoxer package is missing in the local site-packages directories as well.  
Any hint how to ensure, that a pyrthon package is installed in the local execution environment?

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![russoz](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/russoz/32/127_2.png) [@russoz](https://forum.ansible.com/u/russoz)\
**Post date:** [January 10, 2025, 8:39pm UTC](https://forum.ansible.com/t/how-to-handle-local-pipenv/39550/2 "2025-01-10T20:39:34Z")

</div>

Hi there

```auto
pipenv install proxmoxer

```

Executed from within your working directory, that should do the trick.

---

<div class="post-metadata">

**Author:** ![DengelFred](https://avatars.discourse-cdn.com/v4/letter/d/87869e/32.png) [@DengelFred](https://forum.ansible.com/u/DengelFred)\
**Post date:** [January 10, 2025, 8:42pm UTC](https://forum.ansible.com/t/how-to-handle-local-pipenv/39550/3 "2025-01-10T20:42:25Z")

</div>

exactly, but I would like to have it inside the playbook 😉

---

<div class="post-metadata">

**Author:** ![russoz](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/russoz/32/127_2.png) [@russoz](https://forum.ansible.com/u/russoz)\
**Post date:** [January 10, 2025, 8:43pm UTC](https://forum.ansible.com/t/how-to-handle-local-pipenv/39550/4 "2025-01-10T20:43:23Z")

</div>

Oops, jumped the gun.Not sure, try to run with `-vvvv`, else take a look at the codw for `pip`.

---

<div class="post-metadata">

**Author:** ![russoz](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/russoz/32/127_2.png) [@russoz](https://forum.ansible.com/u/russoz)\
**Post date:** [January 11, 2025, 11:16am UTC](https://forum.ansible.com/t/how-to-handle-local-pipenv/39550/5 "2025-01-11T11:16:40Z")

</div>

hi @DengelFred

I was puzzled by this so I thought of playing a bit. I got it to work by forcefully passing the directory:

Say your directory where you have the venv is `/home/project/bubbles`. Then you do:

```yaml
- name: test pipenv handling
  hosts: localhost
  tasks:
    - name: install proxmoxer
      delegate_to: localhost
      ansible.builtin.pip:
        executable: pipenv
        name: proxmoxer
        chdir: /home/project/bubbles

    - ansible.builtin.command: pip list

```

Run `ansible-playbook main.yml -vvvv`, it works fine.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [February 10, 2025, 11:16am UTC](https://forum.ansible.com/t/how-to-handle-local-pipenv/39550/6 "2025-02-10T11:16:43Z")

</div>

Closed on February 10, 2025, 11:16am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
