# "CollectionModuleUtilLocator can only locate below ansible\_collections"

**URL:** <https://forum.ansible.com/t/collectionmoduleutillocator-can-only-locate-below-ansible-collections/3203>\
**Category:** Get Help\
**Tags:** collections\
**Created:** [January 8, 2024, 2:06pm UTC](https://forum.ansible.com/t/collectionmoduleutillocator-can-only-locate-below-ansible-collections/3203 "2024-01-08T14:06:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lorifausti](https://avatars.discourse-cdn.com/v4/letter/l/7ba0ec/32.png) [@lorifausti](https://forum.ansible.com/u/lorifausti)\
**Post date:** [January 8, 2024, 2:06pm UTC](https://forum.ansible.com/t/collectionmoduleutillocator-can-only-locate-below-ansible-collections/3203/1 "2024-01-08T14:06:40Z")

</div>

Hi everyone!  
I’m developing a new collection to backup the configuration files from hp switches.  
I developed the collection following this guide: [Creating collections — Ansible Community Documentation](https://docs.ansible.com/ansible/latest/dev_guide/developing_collections_creating.html) .  
The modules i’ve wrote are ok and they work fine (i tested them as single module), but when i try them through the collection i receive this error:

 ![ansible_help](https://us1.discourse-cdn.com/ansible/original/2X/2/2c3b1c44d7f3806cd119d9f457c38676119ad5c0.png)

I don’t understand! My collection is under ansible\_collection!  
It seems like it does not see the ‘hpswitch’ directory.  
path: /home/rubber/.ansible/collections/ansible\_collections/hpnetworks/hpswitch)  
I try to the create the same collection but in another directory (/home/rubber/Desktop/prova//collections/ansible\_collections/hpnetworks/hpswitch) but it does not work.  
Playbook from which i test the collection:

```auto
- hosts: x

  collections:
    - hpnetworks.hpswitch
  tasks:
    - name: backup running-config 
      hpswitch_config:
        backup: True

```

Can anyone help me please?

---

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [January 8, 2024, 5:23pm UTC](https://forum.ansible.com/t/collectionmoduleutillocator-can-only-locate-below-ansible-collections/3203/2 "2024-01-08T17:23:11Z")

</div>

Your import path is missing the collection’s name (`hwswitch`).

---

<div class="post-metadata">

**Author:** ![lorifausti](https://avatars.discourse-cdn.com/v4/letter/l/7ba0ec/32.png) [@lorifausti](https://forum.ansible.com/u/lorifausti)\
**Post date:** [January 8, 2024, 5:50pm UTC](https://forum.ansible.com/t/collectionmoduleutillocator-can-only-locate-below-ansible-collections/3203/3 "2024-01-08T17:50:49Z")

</div>

You’re right!! In my module i was importing another module from module\_utils, without ‘hpswitch’ in the path.  
I feel so dumb. Thank you very much! Have a nice day ☺

---

<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 7, 2024, 5:50pm UTC](https://forum.ansible.com/t/collectionmoduleutillocator-can-only-locate-below-ansible-collections/3203/4 "2024-02-07T17:50:50Z")

</div>

Closed on February 7, 2024, 5:50pm UTC

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