Python error attempting rto execute manageadmins.py

SOLVED
AChaudry
Conversationalist

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
AChaudry
Conversationalist

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
PhilipDAth
Kind of a big deal
Kind of a big deal

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.

PhilipDAth
Kind of a big deal
Kind of a big deal

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

Mihail
Meraki Employee
Meraki 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

AChaudry
Conversationalist

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

lanlord7
Conversationalist

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

David_Jirku
Meraki Employee
Meraki 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-Per...

 

try using the v1 version of the endpoint.

lanlord7
Conversationalist

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

Get notified when there are additional replies to this discussion.