simpleeval安装问题:使用_2to3无效

Pra*_*ain 4 python linux ubuntu python-poetry

我们正在使用诗歌来升级包并部署到我们的服务器,但有些问题阻止我们将工作持续部署到我们的服务器。下面的代码是我们的代码停止的堆栈跟踪。

\n
$ poetry update \nCreating virtualenv kpbackend-ad2VTdyQ-py3.9 in /root/.cache/pypoetry/virtualenvs\nUpdating dependencies\nResolving dependencies...\nWriting lock file\nPackage operations: 171 installs, 0 updates, 0 removals\n  \xe2\x80\xa2 Installing shortuuid (1.0.1)\n  \xe2\x80\xa2 Installing simpleeval (0.9.10)\n  \xe2\x80\xa2 Installing starkbank-ecdsa (1.1.1)\n  \xe2\x80\xa2 Installing starlette (0.13.8)\n  EnvCommandError\n  Command ['/root/.cache/pypoetry/virtualenvs/kpbackend-ad2VTdyQ-py3.9/bin/pip', 'install', '--no-deps', '/root/.cache/pypoetry/artifacts/49/c9/a8/c45627062eb893ac0685ce1146f6b868eea117d5803fc63c56d21326de/simpleeval-0.9.10.tar.gz'] errored with the following return code 1, and output: \n  Processing /root/.cache/pypoetry/artifacts/49/c9/a8/c45627062eb893ac0685ce1146f6b868eea117d5803fc63c56d21326de/simpleeval-0.9.10.tar.gz\n      ERROR: Command errored out with exit status 1:\n       command: /root/.cache/pypoetry/virtualenvs/kpbackend-ad2VTdyQ-py3.9/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-408xzy97/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-408xzy97/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\\r\\n'"'"', '"'"'\\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-lfjp6ggy\n           cwd: /tmp/pip-req-build-408xzy97/\n      Complete output (1 lines):\n      error in simpleeval setup command: use_2to3 is invalid.\n      ----------------------------------------\n  WARNING: Discarding file:///root/.cache/pypoetry/artifacts/49/c9/a8/c45627062eb893ac0685ce1146f6b868eea117d5803fc63c56d21326de/simpleeval-0.9.10.tar.gz. Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.\n  ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.\n  \n  at /usr/local/lib/python3.9/site-packages/poetry/utils/env.py:1180 in _run\n      1176\xe2\x94\x82                 output = subprocess.check_output(\n      1177\xe2\x94\x82                     cmd, stderr=subprocess.STDOUT, **kwargs\n      1178\xe2\x94\x82                 )\n      1179\xe2\x94\x82         except CalledProcessError as e:\n    \xe2\x86\x92 1180\xe2\x94\x82             raise EnvCommandError(e, input=input_)\n      1181\xe2\x94\x82 \n      1182\xe2\x94\x82         return decode(output)\n      1183\xe2\x94\x82 \n      1184\xe2\x94\x82     def execute(self, bin, *args, **kwargs):\nCleaning up file-based variables\nERROR: Job failed: exit code 1\n
Run Code Online (Sandbox Code Playgroud)\n

我怀疑某些软件包更新破坏了它,因为 3 天前此步骤在 Gitlab CI 中运行良好。

\n

小智 8

我前段时间遇到了同样的错误。该问题似乎与 setuptools 软件包的最新升级有关(https://setuptools.pypa.io/en/latest/history.html#v58-0-0)。对我有用的解决方法是使用 setuptools<=57.5.0。