小编Ljy*_*eon的帖子

如何修复 Python pip install openai 错误:subprocess-exited-with-error

我正在尝试使用 Python 3.11、Windows 操作系统、pip 完全升级来安装 OpenAI,但出现此错误。

\n

这是完整的错误消息:

\n
Collecting openai\n  Using cached openai-0.26.0.tar.gz (54 kB)\n  Installing build dependencies ... done\n  Getting requirements to build wheel ... error\n  error: subprocess-exited-with-error\n\n  \xc3\x97 Getting requirements to build wheel did not run successfully.\n  \xe2\x94\x82 exit code: 1\n  \xe2\x95\xb0\xe2\x94\x80> [21 lines of output]\n      Traceback (most recent call last):\n        File "C:\\Users\\vocal\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\pip\\_vendor\\pep517\\in_process\\_in_process.py", line 351, in <module>\n          main()\n        File "C:\\Users\\vocal\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\pip\\_vendor\\pep517\\in_process\\_in_process.py", line 333, in main\n          json_out[\'return_val\'] = hook(**hook_input[\'kwargs\'])\n                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        File "C:\\Users\\vocal\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\pip\\_vendor\\pep517\\in_process\\_in_process.py", line 118, in get_requires_for_build_wheel\n          return hook(config_settings)\n                 ^^^^^^^^^^^^^^^^^^^^^\n …
Run Code Online (Sandbox Code Playgroud)

python windows python-3.x openai-api gpt-3

4
推荐指数
2
解决办法
2万
查看次数

如何修复错误:使用 lambda python 在 dynamodb 中输入项目

我在使用 lambda 和 dynamodb 时遇到一些问题。

这是我的Python代码:

import json
import boto3

def lambda_handler(event, context):
    client = boto3.client('dynamodb', region_name='ap-northeast-2')
    dynamodb = boto3.resource('dynamodb', region_name='ap-northeast-2')

    response = client.put_item(
        TableName='tablename',
        Item = {
            'key1': 'value1',
            'key2': 'value2',
            'key3': 'value3',
            'key4': 'value4'
                }
        )
Run Code Online (Sandbox Code Playgroud)

这是错误日志:

{
  "errorMessage": "Parameter validation failed:\nInvalid type for parameter Item.key1, value: value1, type: <class 'int'>, valid types: <class 'dict'>\nInvalid type for parameter Item.key2, value: value2, type: <class 'str'>, valid types: <class 'dict'>\nInvalid type for parameter Item.key3, value: value3, type: <class 'str'>, valid …
Run Code Online (Sandbox Code Playgroud)

python amazon-web-services amazon-dynamodb aws-lambda

1
推荐指数
1
解决办法
2256
查看次数