Error in demjson setup command: use_2to3 is invalid

Viewed 739

I'm getting an error when downloading the requirements for my python code on Google cloud functions. I have looked for the error online and have tried everything that I could find to see if I could fix it but nothing has worked. I have read that this error appears when trying to run a code that is python 2 on python 3, but the code that I am using is fairly recent and I don't think that should be the problem. The code I got from Github: https://github.com/togobingi/google_cloud_function/blob/master/ftp_to_bq_cloud_function.py I also gathered that this "use_2to3" error is related to the version of setuptools. I tried to set my setuptools to a version that was prior to 58 but it is still not fixed.

Is there something I have configured wrong? Does anybody know how I can fix this?

Here are the requirements:

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

And here is the error that I'm getting:

  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 timeout-decorator-0.5.0.tar.gz (4.8 kB)
Collecting hgijson>=1.5.0
  Downloading hgijson-3.1.0.tar.gz (22 kB)
Collecting demjson>=2.2.4
  Downloading demjson-2.2.4.tar.gz (131 kB)
    ERROR: Command errored out with exit status 1:
     command: /layers/google.python.pip/pip/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-yawlu8vs/demjson/setup.py'"'"'; __file__='"'"'/tmp/pip-install-yawlu8vs/demjson/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-0qwjfyxi
         cwd: /tmp/pip-install-yawlu8vs/demjson/
    Complete output (1 lines):
    error in demjson setup command: use_2to3 is invalid.
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
0 Answers
Related