admin管理员组文章数量:1026989
I am getting the following error while executing my code in AWS Lambda. The code runs file in VSCode.
The version of pandas i am using :
(.venv) PS C:\code\data_check_lambda> pip show pandas
Name: pandas
Version: 2.2.3
(.venv) PS C:\code\data_check_lambda> python --version
Python 3.11.4
This is the code segment in the python script ( only copying the relevant parts. It works fine when i run in VSCode ( on a windows machine) but gives the error when deployed as AWS Lambda. I have tried different python version 3.11 & 3.9 but same error. :
import pandas as pd
# Convert the items to a DataFrame
df = pd.DataFrame(items)
# Update primary and secondary contact info with names instead of emails
df['primary'] = df['primary'].apply(lambda x: email_to_name(x) if isinstance(x, (str, list)) else x)
df['secondary_contact'] = df['secondary_contact'].apply(lambda x: email_to_name(x) if isinstance(x, (str, list)) else x)
{
"errorMessage": "module 'os' has no attribute 'add_dll_directory'",
"errorType": "AttributeError",
"requestId": "",
"stackTrace": [
" File \"/var/lang/lib/python3.9/importlib/init.py\", line 127, in import_module\n return _bootstrap._gcd_import(name[level:], package, level)\n",
" File \"<frozen importlib._bootstrap>\", line 1030, in _gcd_import\n",
" File \"<frozen importlib._bootstrap>\", line 1007, in _find_and_load\n",
" File \"<frozen importlib._bootstrap>\", line 986, in _find_and_load_unlocked\n",
" File \"<frozen importlib._bootstrap>\", line 680, in _load_unlocked\n",
" File \"<frozen importlib._bootstrap_external>\", line 850, in exec_module\n",
" File \"<frozen importlib._bootstrap>\", line 228, in _call_with_frames_removed\n",
" File \"/var/task/lambda_function.py\", line 3, in <module>\n import pandas as pd\n",
" File \"/opt/python/pandas/init.py\", line 12, in <module>\n _delvewheel_patch_1_8_2()\n",
" File \"/opt/python/pandas/init.py\", line 9, in _delvewheel_patch_1_8_2\n os.add_dll_directory(libs_dir)\n"]
}
I try using Python 3.9, tried using the PATH variable.
I am getting the following error while executing my code in AWS Lambda. The code runs file in VSCode.
The version of pandas i am using :
(.venv) PS C:\code\data_check_lambda> pip show pandas
Name: pandas
Version: 2.2.3
(.venv) PS C:\code\data_check_lambda> python --version
Python 3.11.4
This is the code segment in the python script ( only copying the relevant parts. It works fine when i run in VSCode ( on a windows machine) but gives the error when deployed as AWS Lambda. I have tried different python version 3.11 & 3.9 but same error. :
import pandas as pd
# Convert the items to a DataFrame
df = pd.DataFrame(items)
# Update primary and secondary contact info with names instead of emails
df['primary'] = df['primary'].apply(lambda x: email_to_name(x) if isinstance(x, (str, list)) else x)
df['secondary_contact'] = df['secondary_contact'].apply(lambda x: email_to_name(x) if isinstance(x, (str, list)) else x)
{
"errorMessage": "module 'os' has no attribute 'add_dll_directory'",
"errorType": "AttributeError",
"requestId": "",
"stackTrace": [
" File \"/var/lang/lib/python3.9/importlib/init.py\", line 127, in import_module\n return _bootstrap._gcd_import(name[level:], package, level)\n",
" File \"<frozen importlib._bootstrap>\", line 1030, in _gcd_import\n",
" File \"<frozen importlib._bootstrap>\", line 1007, in _find_and_load\n",
" File \"<frozen importlib._bootstrap>\", line 986, in _find_and_load_unlocked\n",
" File \"<frozen importlib._bootstrap>\", line 680, in _load_unlocked\n",
" File \"<frozen importlib._bootstrap_external>\", line 850, in exec_module\n",
" File \"<frozen importlib._bootstrap>\", line 228, in _call_with_frames_removed\n",
" File \"/var/task/lambda_function.py\", line 3, in <module>\n import pandas as pd\n",
" File \"/opt/python/pandas/init.py\", line 12, in <module>\n _delvewheel_patch_1_8_2()\n",
" File \"/opt/python/pandas/init.py\", line 9, in _delvewheel_patch_1_8_2\n os.add_dll_directory(libs_dir)\n"]
}
I try using Python 3.9, tried using the PATH variable.
本文标签: pythonquotmodule 39os39 has no attribute 39adddlldirectory39quot Stack Overflow
版权声明:本文标题:python - "module 'os' has no attribute 'add_dll_directory'", - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1740316440a1750605.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论