It appears you cannot just import ctypes.windll, you need to import ctypes and then use ctypes.windll. I discovered that by printing all properties of ctypes:
import ctypes
print dir(ctypes)
What's also interesting is that IPython autocompletion was misleading here, because it didn't show windll as a possible choice when TAB-autocompleting after import ctypes..
Trying to take values from a arduino joystick, put it into serial monitor, read it with python and output that as key presses. Sorry for the long winded explanation. When I run it, the pydirectinput has an error called
ctypes' has no attribute 'windll
I know where it is and that it is because I am on Mac, but what do I replace it with?????
Thanks in advance.
[Bug in Experimental] Cannot import windll on Linux
ImportError: cannot import name WINFUNCTYPE
cannot import name 'WinDLL' from 'ctypes' (/usr/lib/python3.9/ctypes/__init__.py)
'az network bastion tunnel' crashes with "cannot import name 'WinDLL' on MacOS
Aws lambda will throw you an error if you don't have the correct version of dependencies packaged with your code, which may depend on the OS (lambda runs on linux) and the python version.
Based on your requirements, it's pandas throwing you the error. To run pandas on lambda, you need to include the following packages:
pandas - code compiled for the linux, which is what lambda runs you. You can find it here https://pypi.org/project/pandas/#files download the 'manylinux' version of the .whl file, that matches your python lambda version.
e.g. if you are running py3.7, then get pandas-0.25.3-cp37-cp37m-manylinux1_x86_64.whl
Unzip the contents of the .whl file into the root folder of your lambda folder. This is the library version that lambda needs
Note for pandas 0.25+, you also need to include the pytz package as well, see note below on requests
numpy - You can now get in lambda (tested for py3.7) through installing a 'layer' through the lambda console, see screenshots below.
- Doesn't seem there's a layer for py3.8 yet so you'll need to do download the correct .whl file from pypi, just like pandas https://pypi.org/project/numpy/#files
Side note on requests
Notice that the package here https://pypi.org/project/requests/#files only have a 'none-any' version, that means the source doesn't need to be compiled, so you can safely include the version you got from pip
this applies to the pytz dependency of pandas as well
Screenshots installing layers in aws console

Since numpy is written in C you should build it for a linux distribution. I recommend you using the serverless framework because it will simplify your life a lot when you are using a Windows laptop.
Install the serverless framework and make sure you have docker
go to the root of your project and execute:
sls create --template aws-python
install the plugin for deploying python apps:
serverless plugin install -n serverless-python-requirements
in your serverless.yml file add:
plugins:
- serverless-python-requirements
custom:
pythonRequirements:
dockerizePip: non-linux
make sure you adjust the path to your lambda function
functions:
hello:
handler: handler.hello
deploy with the correct libraries using
sls deploy