找不到redis-server

0kjbasz6  于 4个月前  发布在  Redis
关注(0)|答案(1)|浏览(76)
  • 我正在为Linux(WSL)开发Windows子系统。
  • 我试图运行一个依赖于redis包的python文件。当我运行python文件时,它会抛出如下错误:
Traceback (most recent call last):
  File "/home/sachinbm/RELEXI/env_relexi/lib/python3.10/site-packages/smartsim/config.py", line 146, in redis_exe
    exe = expand_exe_path(redis_cli)
  File "/home/sachinbm/RELEXI/env_relexi/lib/python3.10/site-packages/smartsim/config.py", line 52, in expand_exe_path
    raise SSConfigError(f"Could not locate executable {exe}")
smartsim.error.errors.SSConfigError: Could not locate executable /home/sachinbm/RELEXI/env_relexi/lib/python3.10/site-packages/smartsim/bin/redis-server

字符串
而redis-server二进制文件存在于

/usr/bin/redis-server


所有文件redis-server,redis-benchmark,redis-check-aof,redis-check-rdb都存在于

/usr/bin


尝试访问redis-server二进制文件的代码是:

def redis_exe(self):
    try:
        redis_bin = self.conf["redis"]["bin"]
        redis_cli = osp.join(redis_bin, "redis-server")
        exe = expand_exe_path(redis_cli)
        return exe
    except KeyError:
        raise SSConfigError("Could not find redis.bin in SmartSim config")
    except SSConfigError as e:
        raise SSConfigError(
            "redis-server exe in SmartSim Config could not be used"
        ) from e


请让我知道如何摆脱这个错误。我应该编辑bashrc或配置文件?

nwlqm0z1

nwlqm0z11#

在Relexi的安装过程中,你被要求执行smart --clobber命令。这个命令从smartsim期望它的文件夹中删除redis-server二进制文件。后来redis-server二进制文件被安装在不同的位置。问题是smartsim==0.3.2和更高版本之间的文件夹结构发生了变化。似乎ENV变量没有正确分配。
所以,做:

pip install smartsim==0.3.2
smart --clobber # maybe avoid this line
smart --clean
smart --no_tf --no_pt -v
SMARTSIM_DIR=$(smart --site)
export PATH=$PATH:$SMARTSIM_DIR/bin # note that '_core/' was removed
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${SMARTSIM_DIR}/lib # note that '_core/' was removed

字符串
然后继续安装。
然而,这个问题与Relexi密切相关,你应该在GitHub页面上打开一个问题。如果不知道你正在尝试安装Relexi,很难追踪到这个问题。

相关问题