获取命令失败:NO_PY2=1

获取命令失败:NO_PY2=1

抱歉,这个问题太琐碎了。我没有使用 Linux 终端的经验。

我正在尝试在 Windows 上的 ubuntu 22 上安装 RedisJSON。

https://redis.io/docs/stack/json/#build-from-source

当我运行命令时

> :~/RedisJSON$ ./sbin/setup

我一直收到错误

sudo bash -l -c 'apt-get -qq update -y'
# readies version: d3ba34e
sudo bash -l -c 'apt-get -qq install --fix-missing -y ca-certificates'
sudo bash -l -c 'apt-get -qq install --fix-missing -y curl wget unzip'
sudo bash -l -c '/home/ubuntu/RedisJSON/deps/readies/bin/enable-utf8'
sudo bash -l -c 'apt-get -qq install --fix-missing -y git unzip rsync'
/home/ubuntu/RedisJSON/deps/readies/bin/getclang --modern
/home/ubuntu/RedisJSON/deps/readies/bin/getrust
/home/ubuntu/RedisJSON/deps/readies/bin/getcmake --usr
sudo bash -l -c 'apt-get -qq install --fix-missing -y python3-dev'
/home/ubuntu/RedisJSON/deps/readies/bin/getgcc
sudo bash -l -c 'apt-get -qq install --fix-missing -y lcov'
/usr/bin/python3 /home/ubuntu/RedisJSON/deps/readies/bin/getrmpytools --reinstall --modern
/usr/bin/python3 -m pip install --disable-pip-version-check --user  -r /home/ubuntu/RedisJSON/tests/pytest/requirements.txt
/home/ubuntu/RedisJSON/deps/readies/bin/getaws
NO_PY2=1 /home/ubuntu/RedisJSON/deps/readies/bin/getpudb
/home/ubuntu/.local/lib/python3.10/site-packages/setuptools/_distutils/dist.py:265: UserWarning: Unknown distribution option: 'test_requires'
  warnings.warn(msg)
running install
/home/ubuntu/.local/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
/home/ubuntu/.local/lib/python3.10/site-packages/setuptools/command/easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
Traceback (most recent call last):
  File "/tmp/pudb.34guko/pudb/setup.py", line 9, in <module>
    setup(
  File "/home/ubuntu/.local/lib/python3.10/site-packages/setuptools/__init__.py", line 108, in setup
    return distutils.core.setup(**attrs)
  File "/home/ubuntu/.local/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 185, in setup
    return run_commands(dist)
  File "/home/ubuntu/.local/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
    dist.run_commands()
  File "/home/ubuntu/.local/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
    self.run_command(cmd)
  File "/home/ubuntu/.local/lib/python3.10/site-packages/setuptools/dist.py", line 1213, in run_command
    super().run_command(command)
  File "/home/ubuntu/.local/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/home/ubuntu/.local/lib/python3.10/site-packages/setuptools/command/install.py", line 74, in run
    self.do_egg_install()
  File "/home/ubuntu/.local/lib/python3.10/site-packages/setuptools/command/install.py", line 117, in do_egg_install
    cmd.ensure_finalized()  # finalize before bdist_egg munges install cmd
  File "/home/ubuntu/.local/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 111, in ensure_finalized
    self.finalize_options()
  File "/home/ubuntu/.local/lib/python3.10/site-packages/setuptools/command/easy_install.py", line 311, in finalize_options
    self.local_index = Environment(self.shadow_path + sys.path)
  File "/home/ubuntu/.local/lib/python3.10/site-packages/pkg_resources/__init__.py", line 1044, in __init__
    self.scan(search_path)
  File "/home/ubuntu/.local/lib/python3.10/site-packages/pkg_resources/__init__.py", line 1077, in scan
    self.add(dist)
  File "/home/ubuntu/.local/lib/python3.10/site-packages/pkg_resources/__init__.py", line 1096, in add
    dists.sort(key=operator.attrgetter('hashcmp'), reverse=True)
  File "/home/ubuntu/.local/lib/python3.10/site-packages/pkg_resources/__init__.py", line 2631, in hashcmp
    self.parsed_version,
  File "/home/ubuntu/.local/lib/python3.10/site-packages/pkg_resources/__init__.py", line 2685, in parsed_version
    raise packaging.version.InvalidVersion(f"{str(ex)} {info}") from None
pkg_resources.extern.packaging.version.InvalidVersion: Invalid version: '1.1build1' (package: distro-info)

In /home/ubuntu/RedisJSON/deps/readies/bin/getpudb:
35                                      xinstall python3-dev
36                              fi
37                              # --prefix= is required for install to succeed
38   >>>                        runn python3 setup.py install $PIP_USER --prefix=
39                              cd /tmp
40                              $OP rm -rf $tmpdir
41                              PY3=1

command failed: NO_PY2=1 /home/ubuntu/RedisJSON/deps/readies/bin/getpudb

In /home/ubuntu/RedisJSON/sbin/setup:
18              python3 -m pip list
19       fi
20
21   >>> $ROOT/sbin/system-setup.py
22       if [[ $VERBOSE == 1 ]]; then
23              python3 -m pip list
24       fi

我不知道该怎么做才能解决这个问题。

答案1

升级到 redis 7 解决了这个问题。

相关内容