cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
6796
Views
9
Helpful
10
Replies

Python error attempting rto execute manageadmins.py

I am using Python on a Windows 10 device to execute manageadmins.py

It does not run and prompts to install the module requests which si already installed and listed in pip list

I have tried Python 3.6.8 and 3.10.0 and requests 2.26 and 2.70

pip 18.? and 21.3 have been tried

I have installed it for the individual and All Users.

All to no luck.

I can stand a linux box but dont have one readily handy.

Any suggestions on what the issue may be?

1 Accepted Solution

Accepted Solutions

Thank you all to everybody who replied. I apologize for the delay but I was sidelined by another project for the last few weeks and was only able to return to this over the weekend.

I had followed the suggestions from Mihail already without any success. It turns out the error message displayed was not the issue. The only resolution I found to the issue was:

1. Delete the existing API key in the Meraki portal and create and use a new one.

Once this was done, I could execute the script and receive erros about admin credentials which I was able to resolve independently on this.

Thank you all,

Amiur

View solution in original post

10 Replies 10

Philip D'Ath
Meraki Community All-Star
Meraki Community All-Star

Maybe the version of requests you are using is to old and needs an update. Try:

pip install -U requests

Hi Philip,

Thank you for the reply.

Ive also tried installing it for a use pip install --user requests but all requirements are already satisfied.

import requests in the python shell has no response so I'm trying to work my way through this.

I will try this but I have installed requests 2.20, 2.24, 2.26 and 2.70 with 2.70 being the latest.

Philip D'Ath
Meraki Community All-Star
Meraki Community All-Star

If you are running Windows 10 have you considered using WSL (Windows Subsystem for Linux)? It runs Ubuntu and is pretty good.

https://docs.microsoft.com/en-us/windows/wsl/install

Hi Philip,

Thanks for the reply. I will try this - it may solve a few issues for me

mpapazog
Cisco Employee
Cisco Employee

I managed to replicate your issue by installing Python 3.10.0 on a Windows computer that already had Python 3.9.5 installed.

I successfully fixed it with the following steps:

* Go to Control Panel > Programs and features and remove all versions of Python, as well as the Python launcher
* Open C:\ in File explorer and remove all PythonXX-XX folders
* Go to Control panel > System > Advanced > Environment variables and remove everything Python related from Path
* Do a clean installation of Python 3.10.0 (I selected the "Add to environment variables" option)
* Install requests via pip
* Run the script as normal. It should now work

Thank you all to everybody who replied. I apologize for the delay but I was sidelined by another project for the last few weeks and was only able to return to this over the weekend.

I had followed the suggestions from Mihail already without any success. It turns out the error message displayed was not the issue. The only resolution I found to the issue was:

1. Delete the existing API key in the Meraki portal and create and use a new one.

Once this was done, I could execute the script and receive erros about admin credentials which I was able to resolve independently on this.

Thank you all,

Amiur

spjeffgricus
Frequent Visitor
Frequent Visitor

Greetings,

I've been using the maangeadmins.py successfully for years now and as recently as a few weeks ago. When attempting to run the script now, I am just presented with a number of warnings that the organization admin list can't be obtained.

@ WARNING: Unable to get admin list for organization ""
@ WARNING: Unable to get admin list for organization ""
@ WARNING: Unable to get admin list for organization ""

I've tried upgrading to the latest version of Python, changing my API key and testing from another Windows 10 machine and from an Ubuntu Linux box.

Running a POSTMAN GET

https://api.meraki.com/api/v0/organizations?X-Cisco-Meraki-API-Key=

does return the list of organizations I can see so I know my API key is valid.

Any assistance would be appreciated.

Thank you,

Jeff

dajirku
Cisco Employee
Cisco Employee

API v0 (which you are pointing at) has been sunset:

https://community.meraki.com/t5/Developers-APIs/Dashboard-API-v0-End-of-Support-Sunset-amp-Grace-Period/m-p/138696

try using the v1 version of the endpoint.

spjeffgricus
Frequent Visitor
Frequent Visitor

Brilliant! Thank you, that resolved the issue. Strange that it worked on v0 up until May 2023. Thanks again.