Python 3.x 谷歌云功能错误与车轮&;pywin32

Python 3.x 谷歌云功能错误与车轮&;pywin32,python-3.x,google-cloud-platform,google-cloud-functions,google-cloud-sdk,Python 3.x,Google Cloud Platform,Google Cloud Functions,Google Cloud Sdk,我第一次尝试在google云函数上部署一个脚本。我浏览了文档,了解了基本情况。然后,我开始尝试部署我的实际脚本。我在requirements.txt文件中遇到一个依赖项错误。我现在还不太清楚自己的问题,所以我会把我做过的事情列出来 使用我的文件名运行gcloud命令gcloud函数deploy FILENAME--runtime python37后,出现以下错误: ERROR: (gcloud.functions.deploy) OperationError: code=3, message=B

我第一次尝试在google云函数上部署一个脚本。我浏览了文档,了解了基本情况。然后,我开始尝试部署我的实际脚本。我在
requirements.txt
文件中遇到一个依赖项错误。我现在还不太清楚自己的问题,所以我会把我做过的事情列出来

使用我的文件名运行gcloud命令
gcloud函数deploy FILENAME--runtime python37
后,出现以下错误:

ERROR: (gcloud.functions.deploy) OperationError: code=3, message=Build failed: 
{
  "error": {
    "canonicalCode": "INVALID_ARGUMENT",
    "errorMessage": "`pip_download_ wheels` had stderr output:\nERROR: Could not find 
                      a version that satisfies the requirement pywin32==227 (from -r requirements.txt (line 32)) 
                      (from versions: n one)\nERROR:\r\nNo matching distribution found for pywin32==227 (from -r requirements.txt (line 32))
                      \n\nerror: `pip_download_wheels` returned code: 1",
    "errorTyp e": "InternalError",
    "errorId": "8C994D6A"
  }
}
这是我的requirements.txt文件:

attrs==19.3.0
autobahn==20.4.3
Automat==20.2.0
cachetools==4.1.0
certifi==2020.4.5.1
cffi==1.14.0
chardet==3.0.4
constantly==15.1.0
cryptography==2.9.2
enum34==1.1.10
google-api-core==1.17.0
google-auth==1.14.1
google-cloud-bigquery==1.24.0
google-cloud-core==1.3.0
google-resumable-media==0.5.0
googleapis-common-protos==1.51.0
hyperlink==19.0.0
idna==2.9
incremental==17.5.0
kiteconnect==3.8.2
numpy==1.18.3
pandas==1.0.3
protobuf==3.11.3
pyarrow==0.17.0
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycparser==2.20
PyHamcrest==2.0.2
pyOpenSSL==19.1.0
python-dateutil==2.8.1
pytz==2020.1
pywin32==227
requests==2.23.0
rsa==4.0
service-identity==18.1.0
six==1.14.0
tqdm==4.45.0
Twisted==20.3.0
txaio==20.4.1
urllib3==1.25.9
wincertstore==0.2
zope.interface==5.1.0
你能帮我找出克服这个错误的方法吗


编辑:根据只在
requirements.txt
文件中保留所需依赖项的建议,我尝试了一下,但得到了一个稍微不同的错误

ERROR: (gcloud.functions.deploy) OperationError: code=3, message=Build failed:
{
  "error": {
    "canonicalCode": "INVALID_ARGUMENT",
    "errorMessage": "`pip_download_\r\nwheels` had stderr output:
                      \n  WARNING: Legacy build of wheel for 'kiteconnect' created no files.
                      \n  Command arguments: /opt/python3.7/bin/python3.7 -u -c 'imp\r\nort sys, setuptools, tokenize; sys.argv[0] = '\"'\"'/tmp/pip-wheel-fdr9r30n/kiteconnect/setup.py'\"'\"'; __file__='\"'\"'/tmp/pip-wheel-fdr9r30n/kiteconnect/s\r\netup.py'\"'\"';f=getattr(tokenize, '\"'\"'open'\"'\"', open)(__file__);code=f.read().replace('\"'\"'\\r\\n'\"'\"', '\"'\"'\\n'\"'\"');f.close();exec(compile(c\r\node, __file__, '\"'\"'exec'\"'\"'))' bdist_wheel -d /tmp/pip-wheel-zkanpa3p\n  Command output: [use --verbose to show]\nERROR: Failed to build one or more whe\r\nels\n\nerror: `pip_download_wheels` returned code: 1",
    "errorType": "InternalError",
    "errorId": "7EF920E4"
  }
}
新的
requirements.txt
文件如下所示:

google-api-core==1.17.0
google-auth==1.14.1
google-cloud-bigquery==1.24.0
google-cloud-core==1.3.0
google-resumable-media==0.5.0
googleapis-common-protos==1.51.0
kiteconnect==3.8.2
numpy==1.18.3
pandas==1.0.3
pyarrow==0.17.0
python-dateutil==2.8.1
tqdm==4.45.0

pywin32
软件包,因此您将无法在Google Cloud Functions运行时安装它


你真的需要它吗?您的
requirements.txt
文件看起来像是
pip freeze
的输出。您可能不需要所有这些依赖项。它应该只包含在函数中导入所需的依赖项。

这很有意义!我试图通过删除所有额外的文件来实现这一点,现在我得到了一个稍微不同的错误。它似乎是围绕着小轮子的东西。我添加了新的error&requirements.txt作为对问题的编辑。对我下一步可以尝试什么有什么建议吗?感谢您的帮助:)@Abhay看起来这是kiteconnect项目的一个问题: