DineshKumar
DineshKumar

Reputation: 1739

No module named syslog (Module Not Found Error) while using awsretry module

I am using awsretry module on my windows machine to try and alter the number of retries/API query request rate to my aws services.

Below is my code which is pretty straightforward.

import boto3
from awsretry import AWSRetry


@AWSRetry.backoff()
def create_service():

    client = boto3.client('sagemaker')
    for i in range(200):
       print(client.list_notebook_instances())


create_service()

I am getting the below error.

 from awsretry import AWSRetry
  File "C:\Users\AppData\Local\Programs\Python\Python37- 
  32\lib\site-packages\awsretry\__init__.py", line 7, in <module>
    import syslog
ModuleNotFoundError: No module named 'syslog'

How do I resolve this? Looks like awsretry internally has dependency on syslog module. I tried installing this via pip, but in vain.

Upvotes: 2

Views: 4095

Answers (2)

DineshKumar
DineshKumar

Reputation: 1739

Posting this as it would be good to know

Just went through the GitHub link of awsretry and they have fixed this issue by replacing syslog with logging. Syslog requires Linux.

import syslog # Removed
import logging # Added

Below is the link for the fix

https://github.com/jhart-r7/awsretry/commit/ddd98a2797b8ef1f6d6311edfc71e2b7fc631877

If you have the code, you may replace syslog occurences with logging line in __init__.py

Upvotes: 3

bcosta12
bcosta12

Reputation: 2452

Try to use virtualenv as shown in awsretry documentation here instead of the pip install awsretry.

Upvotes: 2

Related Questions