- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ansible Script not working - Meraki SDK is not installed. Execute 'pip install meraki'
Hi Everyone.
I am trying to setup ansible to interact with the meraki api, and I am having difficulties.
I am using the instructions provided on the github. https://github.com/meraki/dashboard-api-ansible
However when attempting to perform the basic who_am_i.yml script, it will fail and indicate that the SDK is not installed.
I have attached screenshots of my linux workstation.
Instead of naming the script who_am_i.yml, I created one called helloworld.yml.
Instead of naming the hosts as meraki_servers, it is called meraki.
my Collection output indicating that cisco.meraki is installed and up to date.
My Anisble Version. indicating that the core is 2.17.1 and the python version is 3.12
My helloworld.yml file, the vars_file is extra but in my environement it is required or else the playbook will fail.
The output of the playbook for the task.
The output of pip install meraki indicating it is installed.
While I am uncertain, I think this would be a fraction of the SDK library for meraki but its located in ansible, which is odd.
Any help would be greatly appreciated.
Solved! Go to solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In that case my guess is that ansible is running in a separate Python environment - not the same one as the Meraki module is being installed into.
This post looks related to your issue:
https://community.meraki.com/t5/Developers-APIs/Meraki-SDK-is-not-installed/m-p/235886
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
First install Python on your machine. Once that is installed do a "pip3 install meraki", and if that fails try "pip install meraki".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Python 3.12 is installed on the system, when performing the above commands you mentioned they indicate that "Requirement already satisfied", and the output is exactly the same in regards to pip vs pip3 command. Python has already been re-installed once or twice.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In that case my guess is that ansible is running in a separate Python environment - not the same one as the Meraki module is being installed into.
This post looks related to your issue:
https://community.meraki.com/t5/Developers-APIs/Meraki-SDK-is-not-installed/m-p/235886
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That is correct. I thought it wasnt. but when checking where its running, it is its own virtual environment, I even attempted to have it look outside of that environment but without any luck. so i just copied the entire library over to the virtual environment.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am having same issues - Meraki SDK not installed and Im new to ansible, when you say you copied the entire library, how did you do it? Which library?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For my environment, and most likely other environments, Ansible most likely is going to be installed under a virtual environment, I have noticed this if you use pip to install Ansible.
Please use my photos for reference.
In photo two, the output of ansible --version, you see the "ansible python module" that is where python is looking for the library always.
But in the output of my photo 5, "pip install meraki"
You can see that the location it is placing it is not the same.
My solution was to use the cp -R and place it in the virtual environment.
Basically the default location the python modules are going to is the similar path structure as the virtual environment.
So for example, the commands are going to look similar to:
cp -R /usr/local/lib/<your python version>/site-packages/<package, i.e. urllib3> /home/<your username>/.local/pipx/venvs/<your virtual environment>/lib/<your python version>/site-packages/<package, i.e. urllib3>
cp -R /usr/local/lib64/<your python version>/site-packages/<package, i.e. aiohttp> /home/<your username>/.local/pipx/venvs/<your virtual environment>/lib64/<your python version>/site-packages/<package, i.e. aiohttp>
You can run pip install meraki again to get the packages needed, and where they installed it to.
Please pay attention to keep the lib and lib64 directories the same so you dont place them into incorrect directories.
To ultimately avoid this in the future like if you were to install it again is to run the source command and enter the virtual environment, and then install it that way.
If you install the python library not in the virtual environment first, then any time you wish to install it through the virtual environment it will say its already installed.
I hope this explaination helps you.
