我在 Google 云函数上下载 Python 代码的要求时遇到错误。我已经在网上查找了该错误,并尝试了我能找到的所有方法,看看是否可以修复它,但没有任何效果。我读到,当尝试在 python 3 上运行 python 2 的代码时,会出现此错误,但我使用的代码是相当新的,我认为这不应该是问题所在。我从 Github 获得的代码: https: //github.com/togobingi/google_cloud_function/blob/master/ftp_to_bq_cloud_function.py 我还发现这个“use_2to3”错误与 setuptools 的版本有关。我尝试将 setuptools 设置为 58 之前的版本,但仍然没有修复。
是不是我配置有什么错误?有人知道我该如何解决这个问题吗?
以下是要求:
python-csv==0.0.11
requests==2.13.0
wget==3.2
DateTime==4.3
regex==2019.11.1
python-consul>=0.7.2
timeout-decorator>=0.4.0
hgijson>=1.5.0
demjson>=2.2.4
demjson3>=3.0.5
munch>=2.2.0
setuptools==57.5.0
Run Code Online (Sandbox Code Playgroud)
这是我收到的错误:
Downloading google_cloud_bigquery-1.22.0-py2.py3-none-any.whl (161 kB)
Collecting python-csv==0.0.11
Downloading python-csv-0.0.11.tar.gz (26 kB)
Collecting requests==2.13.0
Downloading requests-2.13.0-py2.py3-none-any.whl (584 kB)
Collecting wget==3.2
Downloading wget-3.2.zip (10 kB)
Collecting DateTime==4.3
Downloading DateTime-4.3-py2.py3-none-any.whl (60 kB)
Collecting regex==2019.11.1
Downloading regex-2019.11.1.tar.gz (669 kB)
Collecting python-consul>=0.7.2
Downloading python_consul-1.1.0-py2.py3-none-any.whl (24 kB)
Collecting timeout-decorator>=0.4.0
Downloading …Run Code Online (Sandbox Code Playgroud)