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

6 REPLIES 6
PhilipDAth
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

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

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

Get notified when there are additional replies to this discussion.
Welcome to the Meraki Community!
To start contributing, simply sign in with your Cisco account. If you don't yet have a Cisco account, you can sign up.