Please fill out the form below.
I have a windows client from where I need to run inference on SageMaker endpoint. I was using SageMaker SDK (1.3.0) to acquire a RealTimePredictor endpoint for running inference and it was working okay. However, with latest SageMaker SDK (1.7.0), sagemaker import is no longer working and fails with an error message ImportError: No module named 'fcntl'
[updated]
How should I handle this? If I recall, boto3 was not fully supporting sagemaker service for client integration. Any help is appreciated
Python 3.5.5 |Anaconda custom (64-bit)| (default, Apr 7 2018, 04:52:34) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sagemaker
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\PopCorn\Anaconda3\envs\py35\lib\site-packages\sagemaker\__init__.py", line 15, in <module>
from sagemaker import estimator # noqa: F401
File "C:\Users\PopCorn\Anaconda3\envs\py35\lib\site-packages\sagemaker\estimator.py", line 25, in <module>
from sagemaker.job import _Job
File "C:\Users\PopCorn\Anaconda3\envs\py35\lib\site-packages\sagemaker\job.py", line 18, in <module>
from sagemaker.local import file_input
File "C:\Users\PopCorn\Anaconda3\envs\py35\lib\site-packages\sagemaker\local\__init__.py", line 15, in <module>
from .local_session import (file_input, LocalSession, LocalSagemakerRuntimeClient,
File "C:\Users\PopCorn\Anaconda3\envs\py35\lib\site-packages\sagemaker\local\local_session.py", line 24, in <module>
from sagemaker.local.image import _SageMakerContainer
File "C:\Users\PopCorn\Anaconda3\envs\py35\lib\site-packages\sagemaker\local\image.py", line 29, in <module>
from fcntl import fcntl, F_GETFL, F_SETFL
ImportError: No module named 'fcntl'
Hi @ChandraLingam ,
Yep in new version we use fcntl which is a linux library and not available on windows. So my suggestion for now is, you could temporarily use sagemaker 1.3.0. And we need to discuss whether and how we want to support windows. I will bring more info later.
Hi @ChandraLingam,
I confirmed that now we don't have plans to support windows. We should make it clear in our README. Since you are using windows 10, is there any chance you could use the bash feature or a simulator like cygwin for it?
Thanks @yangaws. What is the level of support for SageMaker in Boto3. Ideally, we can use boto3; it appears that boto3 does not fully support acquiring endpoints and running inference. Please confirm.
For now, I am using 1.3.0 version of sagemaker sdk; but that is not something we want to do in the long term.
You could use boto3. But I am not sure if that's a good idea since it requires a lot additional work for some features like local mode. So here's an example notebook for doing xgboost using boto3:
You could check whether if fits your need to see if it's a good idea to use boto3.
And one risk here is, the get_execution_role() method still comes from sagemaker python sdk.
Hi @ChandraLingam ,
Since the current fcntl library is only used in local mode which is only a single feature in this SDK, if users cannot even import sagemaker on windows, that is not reasonable. We will work on a fix for this.
We are not ready to officially support windows, as I mentioned before. But we can still fix this problem. I will bring more updates.
Hi @ChandraLingam ,
We have just shipped a change to remove usage of fcntl in SageMaker Python SDK - https://github.com/aws/sagemaker-python-sdk/pull/347
This change will be released to PyPi later today. If you want to test it now you can clone the repository and install it from there. Please let us know if this patch fixes the import failures.
Thank you @icywang86rui
This has been fixed since 1.9.0
Most helpful comment
Hi @ChandraLingam ,
Since the current fcntl library is only used in local mode which is only a single feature in this SDK, if users cannot even import sagemaker on windows, that is not reasonable. We will work on a fix for this.
We are not ready to officially support windows, as I mentioned before. But we can still fix this problem. I will bring more updates.